summaryrefslogtreecommitdiffstats
path: root/base/common/python/pki/client.py
diff options
context:
space:
mode:
authorAde Lee <alee@redhat.com>2014-05-27 14:12:38 -0400
committerAde Lee <alee@redhat.com>2014-05-29 11:29:44 -0400
commit6262dc33b72ea5703959b91dd95f13d732a5d391 (patch)
tree738b751867665b68288629745dcd33c9971b73d6 /base/common/python/pki/client.py
parenta353e5f81341830ea8a151e88ffc2be35aa40451 (diff)
downloadpki-6262dc33b72ea5703959b91dd95f13d732a5d391.tar.gz
pki-6262dc33b72ea5703959b91dd95f13d732a5d391.tar.xz
pki-6262dc33b72ea5703959b91dd95f13d732a5d391.zip
formatting fixes in python client code for pycharm
Diffstat (limited to 'base/common/python/pki/client.py')
-rw-r--r--base/common/python/pki/client.py23
1 files changed, 11 insertions, 12 deletions
diff --git a/base/common/python/pki/client.py b/base/common/python/pki/client.py
index d816053a6..fe9567404 100644
--- a/base/common/python/pki/client.py
+++ b/base/common/python/pki/client.py
@@ -21,14 +21,11 @@
import requests
+
class PKIConnection:
- def __init__(self,
- protocol='http',
- hostname='localhost',
- port='8080',
- subsystem='ca',
- accept='application/json'):
+ def __init__(self, protocol='http', hostname='localhost', port='8080',
+ subsystem='ca', accept='application/json'):
self.protocol = protocol
self.hostname = hostname
@@ -66,17 +63,19 @@ class PKIConnection:
def post(self, path, payload, headers=None, params=None):
r = self.session.post(
- self.serverURI + path,
- verify=False,
- data=payload,
- headers=headers,
- params=params)
+ self.serverURI + path,
+ verify=False,
+ data=payload,
+ headers=headers,
+ params=params)
r.raise_for_status()
return r
+
+
def main():
conn = PKIConnection()
headers = {'Content-type': 'application/json',
- 'Accept': 'application/json'}
+ 'Accept': 'application/json'}
conn.set_authentication_cert('/root/temp4.pem')
print conn.get("", headers).json()