>From 253384596d3bf6c5d51f4bc7f6d9e98a7e12f12c Mon Sep 17 00:00:00 2001
From: Abhishek Koneru <akoneru@redhat.com>
Date: Wed, 17 Jul 2013 14:21:30 -0400
Subject: [PATCH] Fixes for issues reported by pylint.

Fixed the warning W0202 - attributes defined outside init and
error E0202 - An instance attribute hiding a method (which is actually
an error in json.encoder.JSONEncoder line 157.)
---
 base/common/python/pki/encoder.py     |    4 ++--
 base/common/python/pki/system.py      |    2 +-
 base/server/src/engine/pkihelper.py   |    8 ++++----
 base/server/src/engine/pkimanifest.py |    9 ++++++++-
 base/server/src/engine/pkiparser.py   |    2 ++
 5 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/base/common/python/pki/encoder.py b/base/common/python/pki/encoder.py
index 8d8a9c10198cc189b10e1a1ae993c36ab9de25dd..0963751c29d94c76dcaa44bc30f1bd2b2174e4c0 100644
--- a/base/common/python/pki/encoder.py
+++ b/base/common/python/pki/encoder.py
@@ -10,8 +10,8 @@ class CustomTypeEncoder(json.JSONEncoder):
     Custom objects are encoded as JSON object literals (ie, dicts) with
     one key, 'TypeName' where 'TypeName' is the actual name of the
     type to which the object belongs.  That single key maps to another
-    object literal which is just the __dict__ of the object encoded."""
-
+    object literal which is just the __dict__ of the object encoded.E0202"""
+    # pylint: disable-msg=E0202
     def default(self, obj):
         for k, v in TYPES.items():
             if isinstance(obj, v):
diff --git a/base/common/python/pki/system.py b/base/common/python/pki/system.py
index 4dd3baac2ddcafc4763a485ce0e5418c193a6bbd..9ea93677afee865875e72de6aaf95ad21ed8ef0d 100644
--- a/base/common/python/pki/system.py
+++ b/base/common/python/pki/system.py
@@ -25,7 +25,7 @@ import xml.etree.ElementTree as ET
 class SecurityDomainInfo:
 
     def __init__(self):
-        pass
+        self.name = None
 
 class SecurityDomainClient:
 
diff --git a/base/server/src/engine/pkihelper.py b/base/server/src/engine/pkihelper.py
index 39a0b8b9efa2c2765fcc706018dc58ab4abcb66e..6d47a902bb589c5ccccf0433233f042e0d7dd02e 100644
--- a/base/server/src/engine/pkihelper.py
+++ b/base/server/src/engine/pkihelper.py
@@ -1041,7 +1041,7 @@ class Instance:
             raise
 
     def get_instance_status(self):
-        self.connection = pki.client.PKIConnection(
+        connection = pki.client.PKIConnection(
             protocol='https',
             hostname=self.master_dict['pki_hostname'],
             port=self.master_dict['pki_https_port'],
@@ -1049,7 +1049,7 @@ class Instance:
             accept='application/xml')
 
         try:
-            client = pki.system.SystemStatusClient(self.connection)
+            client = pki.system.SystemStatusClient(connection)
             response = client.getStatus()
             config.pki_log.debug(response,
                 extra=config.PKI_INDENTATION_LEVEL_3)
@@ -3070,14 +3070,14 @@ class ConfigClient:
         config.pki_log.info(log.PKI_CONFIG_CONFIGURING_PKI_DATA,
                              extra=config.PKI_INDENTATION_LEVEL_2)
 
-        self.connection = pki.client.PKIConnection(
+        connection = pki.client.PKIConnection(
             protocol='https',
             hostname=self.master_dict['pki_hostname'],
             port=self.master_dict['pki_https_port'],
             subsystem=self.master_dict['pki_subsystem_type'])
 
         try:
-            client = pki.system.SystemConfigClient(self.connection)
+            client = pki.system.SystemConfigClient(connection)
             response = client.configure(data)
 
             config.pki_log.debug(log.PKI_CONFIG_RESPONSE_STATUS + \
diff --git a/base/server/src/engine/pkimanifest.py b/base/server/src/engine/pkimanifest.py
index 09079b4334c713959a5d76735b43515983c40159..dea2af275656f5f319ffedae7012e6f545d48003 100644
--- a/base/server/src/engine/pkimanifest.py
+++ b/base/server/src/engine/pkimanifest.py
@@ -45,7 +45,14 @@ class Record(object):
                "acls",
 
     def __init__(self):
-        pass
+        self.name = None
+        self.type = None
+        self.user = None
+        self.group = None
+        self.uid = None
+        self.gid = None
+        self.permissions = None
+        self.acls = None
 
     def items(self):
         "dict style items"
diff --git a/base/server/src/engine/pkiparser.py b/base/server/src/engine/pkiparser.py
index dfd48b00ddca99927cb0f588ee87eadabe46660c..8dbed8deb97dfcf36a5cf924b06796f827d5e96b 100644
--- a/base/server/src/engine/pkiparser.py
+++ b/base/server/src/engine/pkiparser.py
@@ -83,6 +83,8 @@ class PKIConfigParser:
                           help='directory prefix to specify local directory '
                                '[TEST ONLY]')
         self.indent = 0
+        self.ds_connection = None
+        self.sd_connection = None
 
         # Master and Slot dictionaries
         self.pki_master_dict = dict()
-- 
1.7.10.2

