summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAde Lee <alee@redhat.com>2014-05-07 14:05:31 -0400
committerAde Lee <alee@redhat.com>2014-05-29 11:24:17 -0400
commitfcfdeb637e1d2f72437197627a079c2af74b1f19 (patch)
treeedc3518d858b950b94ab0eff9f36c586d4ef309b
parent6e82fb87ceb3d3650bd9749acd2b66958a9738a6 (diff)
downloadpki-fcfdeb637e1d2f72437197627a079c2af74b1f19.tar.gz
pki-fcfdeb637e1d2f72437197627a079c2af74b1f19.tar.xz
pki-fcfdeb637e1d2f72437197627a079c2af74b1f19.zip
fix issues identified by pycharm for system.py
-rw-r--r--base/common/python/pki/system.py30
-rw-r--r--base/server/python/pki/server/deployment/pkihelper.py2
-rw-r--r--base/server/python/pki/server/deployment/pkiparser.py6
3 files changed, 19 insertions, 19 deletions
diff --git a/base/common/python/pki/system.py b/base/common/python/pki/system.py
index df71c8dab..cada5af69 100644
--- a/base/common/python/pki/system.py
+++ b/base/common/python/pki/system.py
@@ -20,24 +20,24 @@
#
import pki.encoder as encoder
-import xml.etree.ElementTree as ET
+import xml.etree.ElementTree as ETree
import os
SYSTEM_TYPE = "Fedora/RHEL"
if os.path.exists("/etc/debian_version"):
SYSTEM_TYPE = "debian"
-class SecurityDomainInfo(object):
+class SecurityDomainInfo(object):
def __init__(self):
self.name = None
-class SecurityDomainClient(object):
+class SecurityDomainClient(object):
def __init__(self, connection):
self.connection = connection
- def getSecurityDomainInfo(self):
+ def get_security_domain_info(self):
response = self.connection.get('/rest/securityDomain/domainInfo')
info = SecurityDomainInfo()
@@ -45,17 +45,17 @@ class SecurityDomainClient(object):
return info
- def getOldSecurityDomainInfo(self):
+ def get_old_security_domain_info(self):
response = self.connection.get('/admin/ca/getDomainXML')
- root = ET.fromstring(response.text)
- domaininfo = ET.fromstring(root.find("DomainInfo").text)
+ root = ETree.fromstring(response.text)
+ domaininfo = ETree.fromstring(root.find("DomainInfo").text)
info = SecurityDomainInfo()
info.name = domaininfo.find("Name").text
return info
-class ConfigurationRequest(object):
+class ConfigurationRequest(object):
def __init__(self):
self.token = "Internal Key Storage Token"
self.isClone = "false"
@@ -63,18 +63,18 @@ class ConfigurationRequest(object):
self.importAdminCert = "false"
self.generateServerCert = "true"
-class ConfigurationResponse(object):
+class ConfigurationResponse(object):
def __init__(self):
pass
-class SystemCertData(object):
+class SystemCertData(object):
def __init__(self):
pass
-class SystemConfigClient(object):
+class SystemConfigClient(object):
def __init__(self, connection):
self.connection = connection
@@ -84,14 +84,14 @@ class SystemConfigClient(object):
response = self.connection.post('/rest/installer/configure', data, headers)
return response.json()
-class SystemStatusClient(object):
+class SystemStatusClient(object):
def __init__(self, connection):
self.connection = connection
- def getStatus(self):
- response = self.connection.get('/admin/' + \
- self.connection.subsystem + '/getStatus')
+ def get_status(self):
+ response = self.connection.get('/admin/' +
+ self.connection.subsystem + '/getStatus')
return response.text
diff --git a/base/server/python/pki/server/deployment/pkihelper.py b/base/server/python/pki/server/deployment/pkihelper.py
index 8a225ba1f..3c0032ff5 100644
--- a/base/server/python/pki/server/deployment/pkihelper.py
+++ b/base/server/python/pki/server/deployment/pkihelper.py
@@ -988,7 +988,7 @@ class Instance:
# pylint: disable-msg=W0703
try:
client = pki.system.SystemStatusClient(connection)
- response = client.getStatus()
+ response = client.get_status()
config.pki_log.debug(response,
extra=config.PKI_INDENTATION_LEVEL_3)
diff --git a/base/server/python/pki/server/deployment/pkiparser.py b/base/server/python/pki/server/deployment/pkiparser.py
index b0e5fbcb1..8fb29dedc 100644
--- a/base/server/python/pki/server/deployment/pkiparser.py
+++ b/base/server/python/pki/server/deployment/pkiparser.py
@@ -460,13 +460,13 @@ class PKIConfigParser:
def sd_get_info(self):
sd = pki.system.SecurityDomainClient(self.sd_connection)
try:
- info = sd.getSecurityDomainInfo()
+ info = sd.get_security_domain_info()
except requests.exceptions.HTTPError as e:
config.pki_log.info(
"unable to access security domain through REST interface. " + \
"Trying old interface. " + str(e),
extra=config.PKI_INDENTATION_LEVEL_2)
- info = sd.getOldSecurityDomainInfo()
+ info = sd.get_old_security_domain_info()
return info
def sd_authenticate(self):
@@ -523,7 +523,7 @@ class PKIConfigParser:
port=str(parse.port),
subsystem=system_type)
client = pki.system.SystemStatusClient(conn)
- response = client.getStatus()
+ response = client.get_status()
root = ET.fromstring(response)
return root.findtext("Status")