>From 429233af3c245d507924fc0eb251b6d8bf13ac16 Mon Sep 17 00:00:00 2001
From: Ade Lee <alee@redhat.com>
Date: Wed, 7 May 2014 14:05:31 -0400
Subject: [PATCH 171/172] fix issues identified by pycharm for system.py

---
 base/common/python/pki/system.py                   | 30 +++++++++++-----------
 .../python/pki/server/deployment/pkihelper.py      |  2 +-
 .../python/pki/server/deployment/pkiparser.py      |  6 ++---
 3 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/base/common/python/pki/system.py b/base/common/python/pki/system.py
index df71c8dab9508fe7451a5de32261fe93223211ff..cada5af69370e67f84ec0db8e17dfc0064baa0e2 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):
-
     def __init__(self):
         self.name = None
 
+
 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):
-
     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):
-
     def __init__(self):
         pass
 
+
 class SystemCertData(object):
-
     def __init__(self):
         pass
 
+
 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):
-
     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 8a225ba1f6d9f8751316f5397b013661f8c3ac0c..3c0032ff50ea02d8c4b1756cf019f0ee3fab1690 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 b0e5fbcb1fb113eebf627b49bd988ecbab503a21..8fb29dedc16e3853f15190678a368b287f1c6ef1 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")
 
-- 
1.9.0

