<86>Jan 27 04:54:11 userdel[502481]: delete user 'rooter'
<86>Jan 27 04:54:11 userdel[502481]: removed group 'rooter' owned by 'rooter'
<86>Jan 27 04:54:11 userdel[502481]: removed shadow group 'rooter' owned by 'rooter'
<86>Jan 27 04:54:11 groupadd[502504]: group added to /etc/group: name=rooter, GID=1871
<86>Jan 27 04:54:11 groupadd[502504]: group added to /etc/gshadow: name=rooter
<86>Jan 27 04:54:11 groupadd[502504]: new group: name=rooter, GID=1871
<86>Jan 27 04:54:11 useradd[502553]: new user: name=rooter, UID=1871, GID=1871, home=/root, shell=/bin/bash, from=none
<86>Jan 27 04:54:11 userdel[502584]: delete user 'builder'
<86>Jan 27 04:54:11 userdel[502584]: removed group 'builder' owned by 'builder'
<86>Jan 27 04:54:11 userdel[502584]: removed shadow group 'builder' owned by 'builder'
<86>Jan 27 04:54:11 groupadd[502602]: group added to /etc/group: name=builder, GID=1872
<86>Jan 27 04:54:11 groupadd[502602]: group added to /etc/gshadow: name=builder
<86>Jan 27 04:54:11 groupadd[502602]: new group: name=builder, GID=1872
<86>Jan 27 04:54:11 useradd[502623]: new user: name=builder, UID=1872, GID=1872, home=/usr/src, shell=/bin/bash, from=none
<13>Jan 27 04:54:14 rpmi: libmpdec3-2.5.1-alt3 sisyphus+314490.500.5.1 1675432033 installed
<13>Jan 27 04:54:14 rpmi: libgdbm-1.8.3-alt10 sisyphus+278100.1600.1.1 1626059138 installed
<13>Jan 27 04:54:14 rpmi: libexpat-2.5.0-alt1 sisyphus+309227.100.1.1 1667075766 installed
<13>Jan 27 04:54:14 rpmi: libb2-0.98.1-alt1_1 sisyphus+291614.100.1.1 1638962878 installed
<13>Jan 27 04:54:14 rpmi: libp11-kit-1:0.25.3-alt2 sisyphus+336533.100.1.1 1702645575 installed
<13>Jan 27 04:54:14 rpmi: libtasn1-4.19.0-alt3 sisyphus+327816.100.1.1 1692802618 installed
<13>Jan 27 04:54:14 rpmi: rpm-macros-alternatives-0.5.2-alt2 sisyphus+315270.200.2.1 1676457367 installed
<13>Jan 27 04:54:14 rpmi: alternatives-0.5.2-alt2 sisyphus+315270.200.2.1 1676457367 installed
<13>Jan 27 04:54:14 rpmi: ca-certificates-2023.12.20-alt1 sisyphus+336902.300.1.1 1703105726 installed
<13>Jan 27 04:54:14 rpmi: ca-trust-0.1.4-alt1 sisyphus+308690.100.1.1 1666182992 installed
<13>Jan 27 04:54:14 rpmi: p11-kit-trust-1:0.25.3-alt2 sisyphus+336533.100.1.1 1702645575 installed
<13>Jan 27 04:54:14 rpmi: libcrypto3-3.1.4-alt1 sisyphus+332632.100.2.1 1698241305 installed
<13>Jan 27 04:54:14 rpmi: libssl3-3.1.4-alt1 sisyphus+332632.100.2.1 1698241305 installed
<13>Jan 27 04:54:14 rpmi: python3-3.12.1-alt1 sisyphus+338551.300.3.1 1705938690 installed
<13>Jan 27 04:54:14 rpmi: python3-base-3.12.1-alt1 sisyphus+338551.300.3.1 1705938690 installed
<13>Jan 27 04:54:14 rpmi: python3-module-py3dephell-0.1.0-alt2 sisyphus+328191.600.5.1 1693609196 installed
<13>Jan 27 04:54:14 rpmi: tests-for-installed-python3-pkgs-0.1.24-alt2 sisyphus+331059.100.4.1 1696870033 installed
<13>Jan 27 04:54:14 rpmi: rpm-build-python3-0.1.24-alt2 sisyphus+331059.100.4.1 1696870033 installed
<13>Jan 27 04:54:16 rpmi: libreadline7-7.0.3-alt5 sisyphus+328858.200.1.1 1694010663 installed
<13>Jan 27 04:54:16 rpmi: libpython-2.7.18-alt11 sisyphus+328124.4300.1.1 1693252574 installed
<13>Jan 27 04:54:16 rpmi: python2-base-2.7.18-alt11 sisyphus+328124.4300.1.1 1693252574 installed
<13>Jan 27 04:54:16 rpmi: python-modules-encodings-2.7.18-alt11 sisyphus+328124.4300.1.1 1693252574 installed
<13>Jan 27 04:54:16 rpmi: python-modules-compiler-2.7.18-alt11 sisyphus+328124.4300.1.1 1693252574 installed
<13>Jan 27 04:54:16 rpmi: python-modules-email-2.7.18-alt11 sisyphus+328124.4300.1.1 1693252574 installed
<13>Jan 27 04:54:16 rpmi: python-modules-unittest-2.7.18-alt11 sisyphus+328124.4300.1.1 1693252574 installed
<13>Jan 27 04:54:16 rpmi: python-modules-2.7.18-alt11 sisyphus+328124.4300.1.1 1693252574 installed
<13>Jan 27 04:54:16 rpmi: python-modules-ctypes-2.7.18-alt11 sisyphus+328124.4300.1.1 1693252574 installed
<13>Jan 27 04:54:16 rpmi: python-modules-multiprocessing-2.7.18-alt11 sisyphus+328124.4300.1.1 1693252574 installed
<13>Jan 27 04:54:16 rpmi: python-modules-logging-2.7.18-alt11 sisyphus+328124.4300.1.1 1693252574 installed
<13>Jan 27 04:54:16 rpmi: python-tools-2to3-2.7.18-alt11 sisyphus+328124.4300.1.1 1693252574 installed
Building target platforms: i586
Building for target i586
Wrote: /usr/src/in/nosrpm/libsx-2.17-alt2.nosrc.rpm (w1.gzdio)
Installing libsx-2.17-alt2.src.rpm
Building target platforms: i586
Building for target i586
Executing(%prep): /bin/sh -e /usr/src/tmp/rpm-tmp.78351
+ umask 022
+ /bin/mkdir -p /usr/src/RPM/BUILD
+ cd /usr/src/RPM/BUILD
+ cd /usr/src/RPM/BUILD
+ rm -rf sx-2.17
+ echo 'Source #0 (sx-2.17.tar.gz):'
Source #0 (sx-2.17.tar.gz):
+ /bin/gzip -dc /usr/src/RPM/SOURCES/sx-2.17.tar.gz
+ /bin/tar -xf -
+ cd sx-2.17
+ /bin/chmod -c -Rf u+rwX,go-w .
+ sed -i 's|wb|w|' lib/sx/__init__.py
+ find -type f '(' -name '*.py' -o -name sxconsole ')' -exec 2to3 -w -n '{}' +
RefactoringTool: Skipping optional fixer: buffer
RefactoringTool: Skipping optional fixer: idioms
RefactoringTool: Skipping optional fixer: set_literal
RefactoringTool: Skipping optional fixer: ws_comma
RefactoringTool: Refactored ./sxconsole
--- ./sxconsole	(original)
+++ ./sxconsole	(refactored)
@@ -358,7 +358,7 @@
             pluginName = peroidEqualSplit[0].lower()
             pluginOptionName = keyEqualSplit[0].split(".")[1]
             pluginOptionValue = keyEqualSplit[1]
-            if (pluginOptionsMap.has_key(pluginName)) :
+            if (pluginName in pluginOptionsMap) :
                 optionMap = pluginOptionsMap.get(pluginName)
                 optionMap[pluginOptionName] = pluginOptionValue
             else:
@@ -640,8 +640,8 @@
         examplesMessage += "To run the cluster and the checksysreport plugin against a previously extracted report that used the modified layout scheme:\n"
         examplesMessage += "$ %s -p ~/sxarchive/ereports/15555553/2.17-01-26_160247 -e cluster,checksysreport -M\n\n" %(self.__commandName)
         OptionParser.print_help(self)
-        print layoutDescription
-        print examplesMessage
+        print(layoutDescription)
+        print(examplesMessage)
 
 class ExtendOption (Option):
         """
@@ -724,45 +724,45 @@
 
     wasInformationPrintedToConsole = False
     # Print all the paths to files created by the plugins
-    if (len(mapOfPluginReportPaths.keys()) > 0):
+    if (len(list(mapOfPluginReportPaths.keys())) > 0):
         headerPrinted = False
         wasInformationPrintedToConsole = True
-        for key in mapOfPluginReportPaths.keys():
+        for key in list(mapOfPluginReportPaths.keys()):
             index = 1;
             for pathToPluginReport in mapOfPluginReportPaths[key]:
                 if (not index == 1):
-                    print "%s %s" %(ConsoleUtil.colorText("%s plugin File %d: " %(key, index),"lgreen"), pathToPluginReport.replace(homeDirectory, "~"))
+                    print("%s %s" %(ConsoleUtil.colorText("%s plugin File %d: " %(key, index),"lgreen"), pathToPluginReport.replace(homeDirectory, "~")))
                 else:
                     if(headerPrinted):
-                        print "\n%s %s" %(ConsoleUtil.colorText("%s plugin File %d: " %(key, index),"lgreen"), pathToPluginReport.replace(homeDirectory, "~"))
+                        print("\n%s %s" %(ConsoleUtil.colorText("%s plugin File %d: " %(key, index),"lgreen"), pathToPluginReport.replace(homeDirectory, "~")))
                     else:
-                        print "\n%s" %(ConsoleUtil.colorText("List of Files Created by the Plugins: ","lcyan"))
-                        print "%s %s" %(ConsoleUtil.colorText("%s plugin File %d: " %(key, index),"lgreen"), pathToPluginReport.replace(homeDirectory, "~"))
+                        print("\n%s" %(ConsoleUtil.colorText("List of Files Created by the Plugins: ","lcyan")))
+                        print("%s %s" %(ConsoleUtil.colorText("%s plugin File %d: " %(key, index),"lgreen"), pathToPluginReport.replace(homeDirectory, "~")))
                         headerPrinted = True
                 index += 1;
 
     # Print paths to all files that are not reports.
     if (len(listOfNonReportPaths) > 0) :
         wasInformationPrintedToConsole = True
-        print "\n%s" %(ConsoleUtil.colorText("Details for Non-Report Files: ","lcyan"))
+        print("\n%s" %(ConsoleUtil.colorText("Details for Non-Report Files: ","lcyan")))
         index = 1;
         for pathToNonReportFile in listOfNonReportPaths:
             if (index == 1):
                 (dirPath, filename) = os.path.split(pathToNonReportFile)
-                print "%s %s" %(ConsoleUtil.colorText("Non-Report Files Directory:", "lgreen"), dirPath.replace(homeDirectory, "~"))
+                print("%s %s" %(ConsoleUtil.colorText("Non-Report Files Directory:", "lgreen"), dirPath.replace(homeDirectory, "~")))
             spacingCount = 7
             if (index >= 10):
                 spacingCount = 6
-            print "%s %s %s" %(ConsoleUtil.colorText("Non-Report File %d: " %(index),"lgreen"), (" " * spacingCount), pathToNonReportFile.replace(homeDirectory, "~"))
+            print("%s %s %s" %(ConsoleUtil.colorText("Non-Report File %d: " %(index),"lgreen"), (" " * spacingCount), pathToNonReportFile.reRefactoringTool: No changes to ./setup.py
RefactoringTool: No changes to ./lib/sx/__init__.py
RefactoringTool: Refactored ./lib/sx/tools.py
place(homeDirectory, "~")))
             index += 1;
 
     # Print the report archive location
     if ((os.path.exists(pathToCompressedReports)) or
         (os.path.exists(pathToExtractedReports))):
         wasInformationPrintedToConsole = True
-        print "\n%s" %(ConsoleUtil.colorText("Details of Report Extraction: ","lcyan"))
-        print "%s%s" %(ConsoleUtil.colorText("Compressed Reports Directory: ","lgreen"), pathToCompressedReports.replace(homeDirectory, "~"))
-        print "%s%s" %(ConsoleUtil.colorText("Extracted Reports Directory:  ","lgreen"), pathToExtractedReports.replace(homeDirectory, "~"))
+        print("\n%s" %(ConsoleUtil.colorText("Details of Report Extraction: ","lcyan")))
+        print("%s%s" %(ConsoleUtil.colorText("Compressed Reports Directory: ","lgreen"), pathToCompressedReports.replace(homeDirectory, "~")))
+        print("%s%s" %(ConsoleUtil.colorText("Extracted Reports Directory:  ","lgreen"), pathToExtractedReports.replace(homeDirectory, "~")))
 
     if (not wasInformationPrintedToConsole):
         message = "There was zero reports extracted and zero non-report files added."
@@ -806,7 +806,7 @@
         if (cmdLineOpts.listModules):
             versionMessage = "%s %s\n" %(os.path.basename(sys.argv[0]), VERSION_NUMBER)
             versionMessage += "This program was written by Shane Bradley(sbradley@redhat.com): https://fedorahosted.org/sx \n"
-            print versionMessage
+            print(versionMessage)
             reportsHelper = ReportsHelper()
             reportsHelper.printReportsList(includeUserReports=(not cmdLineOpts.disableUserDefinedModules))
             pluginsHelper = PluginsHelper()
@@ -945,7 +945,7 @@
         message =  "This script will exit since control-c was executed by end user."
         logging.getLogger(sx.MAIN_LOGGER_NAME).error(message)
         sys.exit(2)
-    except Exception, e:
+    except Exception as e:
         import time
         import traceback
         errorString = ""
@@ -981,7 +981,7 @@
             logging.getLogger(sx.MAIN_LOGGER_NAME).error(message)
             message = "The data that was going to be written to the file is below: \n%s" %(errorString)
             logging.getLogger(sx.MAIN_LOGGER_NAME).info(message)
-        print errorString
+        print(errorString)
         sys.exit(2)
 
     # #######################################################################
--- ./lib/sx/tools.py	(original)
+++ ./lib/sx/tools.py	(refactored)
@@ -45,7 +45,7 @@
         # Will not parse file if enforceKeys is enabled if the keys
         # are not in configOptionsMap that was passed.
         self.__enforceKeys = True
-        if (len(configOptionsMap.keys()) == 0):
+        if (len(list(configOptionsMap.keys())) == 0):
             self.__enforceKeys = False
 
         # Will not parse file with empty values
@@ -87,7 +87,7 @@
                     value = ""
                 elif ((not len(value) > 0) and (not self.__enforceEmptyValues)):
                     value = ""
-                elif ((not key in self.__configOptionsMap.keys()) and (self.__enforceKeys)):
+                elif ((not key in list(self.__configOptionsMap.keys())) and (self.__enforceKeys)):
                     message = "This is not a valid configuration file because there was an invalid key \"%s\" found." %(key)
                     logging.getLogger(sx.MAIN_LOGGER_NAME).error(message)
                     return False
@@ -123,7 +123,7 @@
         @param optionName: An option in the configuration file.
         @type optionName: String
         """
-        if ((self.__configOptionsMap.has_key(optionName)) and (self.isValid())):
+        if ((optionName in self.__configOptionsMap) and (self.isValid())):
             return self.__configOptionsMap[optionName]
         return ""
 
@@ -196,7 +196,7 @@
                     "purple":"35", "cyan":"36", "lgray":"37", "gray":"1;30", "lred":"1;31",
                     "lgreen":"1;32", "yellow":"1;33", "lblue":"1;34", "pink":"1;35",
                     "lcyan":"1;36", "white":"1;37" }
-        if (not colors.has_key(RefactoringTool: No changes to ./lib/sx/reports/sysreport.py
RefactoringTool: No changes to ./lib/sx/reports/sosreport.py
RefactoringTool: No changes to ./lib/sx/reports/satellitedebug.py
RefactoringTool: No changes to ./lib/sx/reports/rhevlogcollector.py
RefactoringTool: Refactored ./lib/sx/reports/__init__.py
RefactoringTool: Refactored ./lib/sx/plugins/storage.py
RefactoringTool: Refactored ./lib/sx/plugins/satellitedebug.py
RefactoringTool: Refactored ./lib/sx/plugins/rhev.py
RefactoringTool: Refactored ./lib/sx/plugins/opensosreport.py
color)) :
+        if (color not in colors) :
             return  text
         opencol = "\033["
         closecol = "m"
@@ -225,7 +225,7 @@
         """
         while True:
             try:
-                result = raw_input(prompt)
+                result = input(prompt)
                 result = result.lower()
                 if result in ('y', 'ye', 'yes'):
                     return True
@@ -486,7 +486,7 @@
         baseMD5Sum = ""
         # This is map of file paths to md5sum of the contents
         md5sumMap = dict.fromkeys(pathToFilesList)
-        for key in md5sumMap.keys():
+        for key in list(md5sumMap.keys()):
             # Read the file into a string
             fileContents  = ""
             try:
@@ -510,7 +510,7 @@
                 logging.getLogger(sx.MAIN_LOGGER_NAME).error(message)
                 return False
 
-        for key in md5sumMap.keys():
+        for key in list(md5sumMap.keys()):
             if (not md5sumMap.get(key) == baseMD5Sum):
                 return False
         return True
--- ./lib/sx/reports/__init__.py	(original)
+++ ./lib/sx/reports/__init__.py	(refactored)
@@ -37,11 +37,11 @@
         if (not len(loadedReport) > 0):
             logging.getLogger(sx.MAIN_LOGGER_NAME).error("There were no reports found.")
         else:
-            print "List of installed report types:"
+            print("List of installed report types:")
             for report in loadedReport:
-                print "%s(%s):  %s" %(ConsoleUtil.colorText(report.getName(),"lblue"),
+                print("%s(%s):  %s" %(ConsoleUtil.colorText(report.getName(),"lblue"),
                                       report.TYPE_DETECTION_FILE,
-                                      report.getDescription())
+                                      report.getDescription()))
 
 
 class Report:
--- ./lib/sx/plugins/storage.py	(original)
+++ ./lib/sx/plugins/storage.py	(refactored)
@@ -112,9 +112,9 @@
             # Write out any multipath data
             blockDeviceMap = bdt.generateDMBlockDeviceMap()
             multipathMap = bdt.getTargetTypeMap(blockDeviceMap, "multipath")
-            if (len(multipathMap.keys()) > 0):
+            if (len(list(multipathMap.keys())) > 0):
                 self.writeSeperator(filenameSummary, "Multipath Summary", True)
-                for key in multipathMap.keys():
+                for key in list(multipathMap.keys()):
                     self.write(filenameSummary, "%s" %(str(multipathMap.get(key)).strip()))
                 self.write(filenameSummary, "")
 
--- ./lib/sx/plugins/satellitedebug.py	(original)
+++ ./lib/sx/plugins/satellitedebug.py	(refactored)
@@ -104,7 +104,7 @@
         @param pathToRpmManifest: The path to the rpm manifest file.
         @type pathToRpmManifest: String
         """
-        print pathToRpmManifest
+        print(pathToRpmManifest)
         try:
             fin = open(pathToRpmManifest, "r")
             lines = fin.readlines()
--- ./lib/sx/plugins/rhev.py	(original)
+++ ./lib/sx/plugins/rhev.py	(refactored)
@@ -63,14 +63,14 @@
         message = "Performing action for plugin: %s" %(self.getName())
         logging.getLogger(sx.MAIN_LOGGER_NAME).status(message)
 
-        if (len(self.__psDataMap.keys()) > 0):
+        if (len(list(self.__psDataMap.keys())) > 0):
             # Since we are going to run the plugin and create files in
             # the plugins report directory then we will first remove
             # all the existing files.
             self.clean()
 
         summaryFilename = "summary.txt"
-        for key in self.__psDataMap.keys():
+        for key in list(self.__psDataMap.keys()):
             psData = self.__psDataMap.get(key)
             for line in psData:
                 if (line.find("/usr/libexec/vdsm/spmprotect.sh") >= 0):
--- ./lib/sx/plugins/opensosreport.py	(original)
+++ ./lib/sx/plugins/opensosreport.py	(refactored)
@@ -73,7 +73,7 @@
         """
         message = "Performing action for plugin: %s" %(self.getName())
         logging.getLogger(sx.MAIN_LOGGER_NAME).status(message)
-       RefactoringTool: Refactored ./lib/sx/plugins/networking.py
RefactoringTool: No changes to ./lib/sx/plugins/lib/storage/storageevaluator.py
RefactoringTool: Refactored ./lib/sx/plugins/lib/storage/procparser.py
RefactoringTool: Refactored ./lib/sx/plugins/lib/storage/lvm.py
RefactoringTool: Refactored ./lib/sx/plugins/lib/storage/filesysparser.py
 keys = self.__pathToHTMLReportMap.keys()
+        keys = list(self.__pathToHTMLReportMap.keys())
         keys.sort()
         for key in keys:
             message = "Opening a tab that contains the generated html report for sosreport: %s" %(key)
--- ./lib/sx/plugins/networking.py	(original)
+++ ./lib/sx/plugins/networking.py	(refactored)
@@ -168,7 +168,7 @@
                 # Get all the data from proc/net including the bonding data.
                 procNetMap = report.getDataFromDir("proc/net")
                 bondingMap = report.getDataFromDir("proc/net/bonding")
-                procNetMap = dict(procNetMap.items() + bondingMap.items())
+                procNetMap = dict(list(procNetMap.items()) + list(bondingMap.items()))
 
                 # Get all the data in the sos_commands/networking directory.
                 networkingCommandsMap = report.getDataFromDir("sos_commands/networking")
@@ -242,8 +242,8 @@
             # Aliases Interface Summary
             aliasesInterfaceTable = []
             networkInterfaceAliasMap = networkMaps.getNetworkInterfaceAliasMap()
-            for key in networkInterfaceAliasMap.keys():
-                for key in networkInterfaceAliasMap.keys():
+            for key in list(networkInterfaceAliasMap.keys()):
+                for key in list(networkInterfaceAliasMap.keys()):
                     aliasInterfacesString =  ""
                     for networkMap in networkInterfaceAliasMap[key]:
                         aliasInterfacesString += " %s |" %(networkMap.getInterface())
--- ./lib/sx/plugins/lib/storage/procparser.py	(original)
+++ ./lib/sx/plugins/lib/storage/procparser.py	(refactored)
@@ -115,7 +115,7 @@
         currentScsiDevice = {}
         for line in procScsiScsiData:
             if (line.startswith("Host:")):
-                if (len(currentScsiDevice.keys()) == 9):
+                if (len(list(currentScsiDevice.keys())) == 9):
                     parsedList.append(ProcScsiScsi(currentScsiDevice.get("host"),
                                                    currentScsiDevice.get("channel"),
                                                    currentScsiDevice.get("channelID"),
--- ./lib/sx/plugins/lib/storage/lvm.py	(original)
+++ ./lib/sx/plugins/lib/storage/lvm.py	(refactored)
@@ -88,7 +88,7 @@
 
     def getAttribute(self, attributeName):
         attributesMap = self.getAttributesMap()
-        if (attributesMap.has_key("clustered")):
+        if ("clustered" in attributesMap):
             return attributesMap.get("clustered")
         return ""
 
--- ./lib/sx/plugins/lib/storage/filesysparser.py	(original)
+++ ./lib/sx/plugins/lib/storage/filesysparser.py	(refactored)
@@ -57,7 +57,7 @@
                 # skip comments and empty lines
                 continue
             elif (line.startswith("[") and line.endswith("]")):
-                if ((len(lastSectionName) > 0) or (len(lastSectionMap.keys()) > 0)):
+                if ((len(lastSectionName) > 0) or (len(list(lastSectionMap.keys())) > 0)):
                     parsedList.append(EtcSambaSmbConfSection(lastSectionName, lastSectionMap))
                 lastSectionName = line.strip("[").rstrip("]")
                 lastSectionMap = {}
@@ -66,7 +66,7 @@
                 if (len(optionValueSplit) ==  2):
                     lastSectionMap[optionValueSplit[0].strip()] = optionValueSplit[1].strip()
         # Add last section:
-        if ((len(lastSectionName) > 0) or (len(lastSectionMap.keys()) > 0)):
+        if ((len(lastSectionName) > 0) or (len(list(lastSectionMap.keys())) > 0)):
             parsedList.append(EtcSambaSmbConfSection(lastSectionName, lastSectionMap))
         return parsedList
     parseEtcSambaSmbConfData = staticmethod(parseEtcSambaSmbConfData)
@@ -144,10 +144,10 @@
         return self.__mountPoint
 
     def getClients(self):
-        return self.__clientsOptionsMap.keys()
+        return list(self.__clientsOptionsMap.keys())
 
     def getClientOptions(self, client):
-        if (self.__clientsOptionsMap.has_key(client)):
+        if (client in self.__clientsOptionsMap):
RefactoringTool: No changes to ./lib/sx/plugins/lib/storage/devicemapperparser.py
RefactoringTool: Refactored ./lib/sx/plugins/lib/storage/blockdevicetree.py
             return self.__clientsOptionsMap.get(client)
         return []
 
@@ -158,7 +158,7 @@
 
     def __str__(self):
         rString = self.getSectionName()
-        for key in self.__sectionMap.keys():
+        for key in list(self.__sectionMap.keys()):
             rString += "\n\t%s = %s" %(key, self.__sectionMap.get(key))
         return rString
 
@@ -166,10 +166,10 @@
         return self.__sectionName
 
     def getOptionsNames(self):
-        return self.__sectionMap.keys()
+        return list(self.__sectionMap.keys())
 
     def getOptionValue(self, optionName):
-        if (self.__sectionMap.has_key(optionName)):
+        if (optionName in self.__sectionMap):
             return self.__sectionMap.get(optionName).strip()
         return ""
 
--- ./lib/sx/plugins/lib/storage/blockdevicetree.py	(original)
+++ ./lib/sx/plugins/lib/storage/blockdevicetree.py	(refactored)
@@ -203,11 +203,11 @@
         # This map is key == "major:minor" pair and value is the
         # DeviceMapperBlockDevice. This will be based on what is in proc/partitions
         blockDeviceMap = {}
-        if (not len(self.getDMSetupInfoMap().keys())):
+        if (not len(list(self.getDMSetupInfoMap().keys()))):
             message = "The block device tree will not be generated since there was no dmsetup_info data."
             logging.getLogger(sx.MAIN_LOGGER_NAME).warning(message)
             return blockDeviceMap
-        elif (not len(self.getProcPartitionsMap().keys())):
+        elif (not len(list(self.getProcPartitionsMap().keys()))):
             message = "The block device tree will not be generated since there was no /proc/partitions data."
             logging.getLogger(sx.MAIN_LOGGER_NAME).warning(message)
             return blockDeviceMap
@@ -226,7 +226,7 @@
         deviceMapperMajorNumber = self.__getDeviceMapperMajorNumber()
 
         # Build the map of all the block devices
-        for key in self.__procPartitionsMap.keys():
+        for key in list(self.__procPartitionsMap.keys()):
             procPartition = self.__procPartitionsMap.get(key)
 
             # Create a blockdevice on everything first and we can
@@ -238,9 +238,9 @@
             if (not (deviceMapperMajorNumber == procPartition.getMajorNumber())):
                 # If there is a mount point for this device name then
                 # set the mount point.
-                if (relativeFilesysMountMap.has_key(blockDevice.getDeviceName())):
+                if (blockDevice.getDeviceName() in relativeFilesysMountMap):
                     blockDevice.setMountPoint(relativeFilesysMountMap[blockDevice.getDeviceName()].getMountPoint())
-            elif (self.getDMSetupInfoMap().has_key(key)):
+            elif (key in self.getDMSetupInfoMap()):
                 # If this is a devicemapper block device then create a
                 # DeviceMapperBlockDevice instead.
 
@@ -257,19 +257,19 @@
 
                 # If there is a mount point for this devicemapper name
                 # then set the mount point.
-                if (relativeFilesysMountMap.has_key(deviceMapperName)):
+                if (deviceMapperName in relativeFilesysMountMap):
                     blockDevice.setMountPoint(relativeFilesysMountMap[deviceMapperName].getMountPoint())
             # Add the blockDevice to the map
             blockDeviceMap[key] = blockDevice
 
         # Now build the dependencies tree
-        for key in blockDeviceMap.keys():
+        for key in list(blockDeviceMap.keys()):
             currentBlockDevice = blockDeviceMap[key]
             if ((deviceMapperMajorNumber == currentBlockDevice.getMajorNumber()) and
-                (self.getDMSetupInfoMap().has_key(key))):
+                (key in self.getDMSetupInfoMap())):
                 mmDepsPairs = currentBlockDevice.getMajorMinorPairDependenciesList()
                 for mmPair in mmDepsPairs:
-                    if (blockDeviceMap.has_key(mmPair)):
+                    if (mmPair in blockDeviceMap):
                         currentBlockDevice.addBlockDeviceDependency(blockDeviceMap[mmPair])
     RefactoringTool: No changes to ./lib/sx/plugins/lib/storage/__init__.py
RefactoringTool: Refactored ./lib/sx/plugins/lib/rpm/rpmparser.py
RefactoringTool: No changes to ./lib/sx/plugins/lib/rpm/__init__.py
RefactoringTool: Refactored ./lib/sx/plugins/lib/networking/networkdeviceparser.py
    return blockDeviceMap
 
@@ -286,7 +286,7 @@
         if (not (targetType in self.__validTargetTypes)):
             return blockDeviceMap
         rMap = {}
-        for key in blockDeviceMap.keys():
+        for key in list(blockDeviceMap.keys()):
             currentBlockDevice = blockDeviceMap[key]
             if(currentBlockDevice.__class__.__name__ == "DeviceMapperBlockDevice"):
                 if (currentBlockDevice.getTargetType() == targetType):
@@ -296,20 +296,20 @@
     def getSummary(self):
         rstring = ""
         blockDeviceMap = self.generateDMBlockDeviceMap()
-        if (not len(blockDeviceMap.keys())):
+        if (not len(list(blockDeviceMap.keys()))):
             return rstring
         # Print a summary of the devicemapper devices. Group by target type.
         for targetType in self.__validTargetTypes:
             currentBlockDeviceMap = self.getTargetTypeMap(blockDeviceMap, targetType)
             if (len(currentBlockDeviceMap) > 0):
                 rstring += "Target Type: %s (%d targets)\n------------------------------------------\n" %(targetType, len(currentBlockDeviceMap))
-                for key in currentBlockDeviceMap.keys():
+                for key in list(currentBlockDeviceMap.keys()):
                     currentBlockDevice = currentBlockDeviceMap[key]
                     rstring += "\n%s\n-------\n" %str(currentBlockDevice)
                 rstring += "\n"
 
         rstring += "Non-DeviceMapper Devices \n------------------------------------------\n"
-        for key in blockDeviceMap.keys():
+        for key in list(blockDeviceMap.keys()):
             currentBlockDevice = blockDeviceMap[key]
             if(not (currentBlockDevice.__class__.__name__ == "DeviceMapperBlockDevice")):
                 rstring += "\n%s\n\n-------\n" %str(currentBlockDevice)
--- ./lib/sx/plugins/lib/rpm/rpmparser.py	(original)
+++ ./lib/sx/plugins/lib/rpm/rpmparser.py	(refactored)
@@ -49,8 +49,8 @@
                 parsedList.append(installedRPMS)
                 """
             else:
-                print packageFullName
-        print "\nAre the counts the same? \n\tinstalledRPMSData: %d\n\tparsedList:        %d" %(len(installedRPMSData), len(parsedList))
+                print(packageFullName)
+        print("\nAre the counts the same? \n\tinstalledRPMSData: %d\n\tparsedList:        %d" %(len(installedRPMSData), len(parsedList)))
         return parsedList
     parseInstalledRPMSData = staticmethod(parseInstalledRPMSData)
 
@@ -134,13 +134,13 @@
             mo = rem.match(line)
             if mo:
                 moDict = mo.groupdict()
-                for key in moDict.keys():
+                for key in list(moDict.keys()):
                     if (not moDict[key] == None):
                         # Dont include the date of installed
                         packageVersionDict[key.replace("__", "-")].append(moDict[key].split(" ", 1)[0].strip())
 
         # Remove packages that have empty array which means package was not found.
-        keys = packageVersionDict.keys()
+        keys = list(packageVersionDict.keys())
         for key in keys:
             if (not len(packageVersionDict[key]) > 0):
                 del packageVersionDict[key]
--- ./lib/sx/plugins/lib/networking/networkdeviceparser.py	(original)
+++ ./lib/sx/plugins/lib/networking/networkdeviceparser.py	(refactored)
@@ -62,7 +62,7 @@
                 hostnamesNoComments = hostnames.split("#")[0]
                 hostnamesNoComments = hostnamesNoComments.split()
                 # If the key is already in map then just combine the arrays.
-                if (etcHostsMap.has_key(ipAddress)):
+                if (ipAddress in etcHostsMap):
                     etcHostsMap[ipAddress] = (etcHostsMap[ipAddress] + hostnamesNoComments)
                 else:
                      etcHostsMap[ipAddress] = hostnamesNoComments
@@ -245,7 +245,7 @@
         subnetMask = SimpleUtil.castInt(subnetMask)
         if (not subnetMask == None):
             bits = 0
-            for i in xrange(32-subnetMask,32):
+            for i in range(32-subnetMask,32):
                 bits |= (1 << i)
             return "%d.%d.%d.%d" % ((bits & 0xff000000) >> 24, (bits & 0xff0000) >> 16, (bits & 0xff00) >> 8 , (bits & 0xff))
         return ""
@@ -316,15 +316,15 @@
                  networkingCommandsMap):
         # If interface is not found, but sysconfig file has data then search it.
         if (not len(ipv4Addr) > 0):
-            if (networkScriptMap.has_key("IPADDR")):
+            if ("IPADDR" in networkScriptMap):
                 if (len(networkScriptMap.get("IPADDR")) > 0):
                     ipv4Addr = networkScriptMap.get("IPADDR")
         if (not len(subnetMask) > 0):
-            if (networkScriptMap.has_key("NETMASK")):
+            if ("NETMASK" in networkScriptMap):
                 if (len(networkScriptMap.get("NETMASK")) > 0):
                     subnetMask = networkScriptMap.get("NETMASK")
         if (not len(hwAddr) > 0):
-            if (networkScriptMap.has_key("HWADDR")):
+            if ("HWADDR" in networkScriptMap):
                 if (len(networkScriptMap.get("HWADDR")) > 0):
                     hwAddr = networkScriptMap.get("HWADDR")
 
@@ -338,7 +338,7 @@
         self.__procNetMap = procNetMap
         self.__networkingCommandsMap = networkingCommandsMap
         self.__hostnames = []
-        if (self.__etcHostsMap.has_key(self.getIPv4Address())):
+        if (self.getIPv4Address() in self.__etcHostsMap):
             self.__hostnames = self.__etcHostsMap.get(self.getIPv4Address())
         # Bonded options
         self.__bondedModeNumber = None
@@ -372,7 +372,7 @@
     def __getEthToolIMap(self):
         ethtoolIMap = {}
         networkingCommandsMap = self.getNetworkingCommandsMap()
-        for key in networkingCommandsMap.keys():
+        for key in list(networkingCommandsMap.keys()):
             if (key.startswith("ethtool_-i_")):
                 newKey = key.replace("ethtool_-i_", "")
                 newValue = NetworkDeviceParser.parseEthtoolIData(networkingCommandsMap.get(key))
@@ -381,7 +381,7 @@
 
     def __getEthToolIDeviceMap(self, interface):
         ethtoolIMap = self.__getEthToolIMap()
-        if (ethtoolIMap.has_key(interface)):
+        if (interface in ethtoolIMap):
             return ethtoolIMap.get(interface)
         return {}
 
@@ -392,13 +392,13 @@
         # Returns True if a particular hostname is in the /etc/hosts
         # file. The hostname does not have to be associated with this
         # particular interface.
-        for key in self.getEtcHostsMap().keys():
+        for key in list(self.getEtcHostsMap().keys()):
             if (hostname in self.getEtcHostsMap().get(key)):
                 return True
         return False
 
     def isOnBootEnabled(self):
-        if (self.getNetworkScriptMap().has_key("ONBOOT")):
+        if ("ONBOOT" in self.getNetworkScriptMap()):
             if self.getNetworkScriptMap().get("ONBOOT") == "yes":
                 return True
         return False
@@ -442,12 +442,12 @@
 
     def getBootProtocal(self):
         bootProtocal = ""
-        if (self.getNetworkScriptMap().has_key("BOOTPROTO")):
+        if ("BOOTPROTO" in self.getNetworkScriptMap()):
             bootProtocal = self.getNetworkScriptMap().get("BOOTPROTO")
             if (bootProtocal.lower() == "none"):
                 # If bootproto is none and they have set IPADDR then
                 # they are using static ip addressing.
-                if (self.getNetworkScriptMap().has_key("IPADDR")):
+                if ("IPADDR" in self.getNetworkScriptMap()):
                     if (len(self.getNetworkScriptMap().get("IPADDR")) > 0):
                         bootProtocal = "static"
         return bootProtocal
@@ -460,7 +460,7 @@
                 return modprobeCommand.getModuleName()
 
         ethtoolIDeviceMap = self.__getEthToolIDeviceMap(self.getInterface())
-        if (ethtoolIDeviceMap.has_key("driver")):
+        if ("driver" in ethtoolIDeviceMap):
             return ethtoolIDeviceMap.get("driver")
         # There is no module loaded for the loopback interface and I have
         # verified this.
@@ -479,8 +479,8 @@
                 (int(self.getBondedModeNumber()) >= 0))
 
     def isBondedSlaveInterface(self):
-        print self.getNetworkScriptMap().keys()
-        if (self.getNetworkScriptMap().has_key("SLAVE")):
+        print(list(self.getNetworkScriptMap().keys()))
+        if ("SLAVE" in self.getNetworkScriptMap()):
             return ((self.getNetworkScriptMap().get("SLAVE").lower() == "yes") and
                     (len(self.getBondedMasterInterface()) > 0))
         return False
@@ -492,7 +492,7 @@
         self.__listOfBondedSlaveInterfaces.append(slaveInterface)
 
     def getBondedMasterInterface(self):
-        if (self.getNetworkScriptMap().has_key("MASTER")):
+        if ("MASTER" in self.getNetworkScriptMap()):
             return self.getNetworkScriptMap().get("MASTER")
         return ""
 
@@ -507,7 +507,7 @@
                     interfaceAlias = modprobeCommand.getModuleName()
 
         bondingOptions = ""
-        if (self.getNetworkScriptMap().has_key("BONDING_OPTS")):
+        if ("BONDING_OPTS" in self.getNetworkScriptMap()):
             bondingOptions = self.getNetworkScriptMap().get("BONDING_OPTS")
         for modprobeCommand in self.getModprobeConfCommands():
             if (modprobeCommand.getCommand().lower() == "options"):
@@ -527,25 +527,25 @@
                 if (len(optionSplit) == 2):
                     if (optionSplit[0].lower() == "mode"):
                         bondingMode = optionSplit[1]
-                        for key in BONDING_MODES_MAP.keys():
+                        for key in list(BONDING_MODES_MAP.keys()):
                             value = BONDING_MODES_MAP.get(key)
                             if (bondingMode == key or bondingMode == value):
                                 # Set number
                                 self.__bondedModeNumber = key
                                 return self.__bondedModeNumber
-            if ((not int(self.__bondedModeNumber) > 0) and (self.__procNetMap.has_key(self.getInterface()))):
+            if ((not int(self.__bondedModeNumber) > 0) and (self.getInterface() in self.__procNetMap)):
                 bondingData = self.__procNetMap.get(self.getInterface())
                 for line in bondingData:
                     lineSplit = line.split(":")
                     if ((len(lineSplit) >= 2) and lineSplit[0].startswith("Bonding Mode")):
                         bondingModeName = lineSplit[1].strip().rstrip("\n")
-                        if (BONDING_MODE_NAMES_MAP.has_key(bondingModeName)):
+                        if (bondingModeName in BONDING_MODE_NAMES_MAP):
                             self.__bondedModeNumber = BONDING_MODE_NAMES_MAP.get(bondingModeName)
         return self.__bondedModeNumber
 
     def getBondedModeName(self):
         bondedModeNumber = self.getBondedModeNumber()
-        if (BONDING_MODES_MAP.has_key(bondedModeNumber)):
+        if (bondedModeNumber in BONDING_MODES_MAP):
             return BONDING_MODES_MAP[bondedModeNumber]
         return ""
 
@@ -562,17 +562,17 @@
     # Bridge functions
     # ###########################################################################
     def isBridgedInterface(self):
-        if (self.getNetworkScriptMap().has_key("BRIDGE")):
+        if ("BRIDGE" in self.getNetworkScriptMap()):
             return (len(self.getNetworkScriptMap().get("BRIDGE").lower()) > 0)
         return False
 
     def isVirtualBridgedInterface(self):
-        if (self.getNetworkScriptMap().has_key("TYPE")):
+        if ("TYPE" in self.getNetworkScriptMap()):
             return (self.getNetworkScriptMap().get("TYPE").lower() == "bridge")
         return False
 
     def getVirtualBridgedInterface(self):
-        if (self.getNetworkScriptMap().has_key("BRIDGE")):
+        if ("BRIDGE" in self.getNetworkScriptMap()):
             return self.getNetworkScriptMap().get("BRIDGE")
         return ""
 
@@ -605,7 +605,7 @@
         for networkInterface in self.__networkInterfaces:
             #print networkInterface.getInterface()
             networkRefactoringTool: No changes to ./lib/sx/plugins/lib/networking/__init__.py
RefactoringTool: No changes to ./lib/sx/plugins/lib/log/syslogparser.py
RefactoringTool: No changes to ./lib/sx/plugins/lib/log/__init__.py
RefactoringTool: No changes to ./lib/sx/plugins/lib/kernel/modulesparser.py
RefactoringTool: No changes to ./lib/sx/plugins/lib/kernel/__init__.py
RefactoringTool: Refactored ./lib/sx/plugins/lib/gluster/glusterpeernodes.py
ScriptMap = NetworkDeviceParser.parseEtcSysconfigNetworkScript(self.__networkScriptsDataMap.get(networkInterface.getInterface()))
-            if (not mapOfNetworkMaps.has_key(networkInterface.getInterface())):
+            if (networkInterface.getInterface() not in mapOfNetworkMaps):
                 networkMap = NetworkMap(networkInterface.getInterface(),
                                         networkInterface.getHardwareAddress(),
                                         networkInterface.getIPv4Address(),
@@ -620,31 +620,31 @@
                 mapOfNetworkMaps[networkInterface.getInterface()] = networkMap
         # After Maps are created then set the bonding interface for any of them.
         # print "CHECK THAT USE CASE FOR WHEN NETWORKING HAS NO IPS. Problem is ifconfig data does not contain the bond0 that is not up."
-        for key in mapOfNetworkMaps.keys():
+        for key in list(mapOfNetworkMaps.keys()):
             masterBondedInterface = mapOfNetworkMaps[key].getBondedMasterInterface().replace("\"", "")
-            if (mapOfNetworkMaps.has_key(masterBondedInterface)):
+            if (masterBondedInterface in mapOfNetworkMaps):
                 mapOfNetworkMaps[masterBondedInterface].addBondedSlaveInterfaces(mapOfNetworkMaps[key])
 
         # Set all the parent aliases if there is one.
-        for key in mapOfNetworkMaps.keys():
+        for key in list(mapOfNetworkMaps.keys()):
             currentNetworkMap = mapOfNetworkMaps[key]
             interfaceNameSplit = currentNetworkMap.getInterface().split(".")
-            if ((len(interfaceNameSplit) == 2) and (mapOfNetworkMaps.has_key(interfaceNameSplit[0]))):
+            if ((len(interfaceNameSplit) == 2) and (interfaceNameSplit[0] in mapOfNetworkMaps)):
                 currentNetworkMap.setParentAliasNetworkMap(mapOfNetworkMaps.get(interfaceNameSplit[0]))
             else:
                 interfaceNameSplit = currentNetworkMap.getInterface().split(":")
-                if ((len(interfaceNameSplit) == 2) and (mapOfNetworkMaps.has_key(interfaceNameSplit[0]))):
+                if ((len(interfaceNameSplit) == 2) and (interfaceNameSplit[0] in mapOfNetworkMaps)):
                     currentNetworkMap.setParentAliasNetworkMap(mapOfNetworkMaps.get(interfaceNameSplit[0]))
 
         # Add any virtual bridge devices to any bridge interfaces.
-        for key in mapOfNetworkMaps.keys():
+        for key in list(mapOfNetworkMaps.keys()):
             virtualBridgeInterface = mapOfNetworkMaps[key].getVirtualBridgedInterface()
-            if (mapOfNetworkMaps.has_key(virtualBridgeInterface)):
+            if (virtualBridgeInterface in mapOfNetworkMaps):
                 mapOfNetworkMaps[key].setVirtualBridgedNetworkMap(mapOfNetworkMaps[virtualBridgeInterface])
         return mapOfNetworkMaps
 
     def getListOfNetworkMaps(self):
-        listOfNetworkMaps = self.__mapOfNetworkMaps.values()
+        listOfNetworkMaps = list(self.__mapOfNetworkMaps.values())
         listOfNetworkMaps.sort(key=lambda m: m.getInterface())
         return listOfNetworkMaps
 
@@ -671,7 +671,7 @@
             parentAliasNetworkMap = networkMap.getParentAliasNetworkMap()
             if (not parentAliasNetworkMap == None):
                 currentInterface = parentAliasNetworkMap.getInterface()
-                if (currentInterface in networkInterfaceAliasMap.keys()):
+                if (currentInterface in list(networkInterfaceAliasMap.keys())):
                     networkInterfaceAliasMap[currentInterface].append(networkMap)
                 else:
                     networkInterfaceAliasMap[currentInterface] = [networkMap]
--- ./lib/sx/plugins/lib/gluster/glusterpeernodes.py	(original)
+++ ./lib/sx/plugins/lib/gluster/glusterpeernodes.py	(refactored)
@@ -74,7 +74,7 @@
         # Get all the data from proc/net including the bonding data.
         procNetMap = report.getDataFromDir("proc/net")
         bondingMap = report.getDataFromDir("proc/net/bonding")
-        procNetMap = dict(procNetMap.items() + bondingMap.items())
+        procNetMap = dict(list(procNetMap.itemRefactoringTool: No changes to ./lib/sx/plugins/lib/gluster/glusterpeernode.py
RefactoringTool: No changes to ./lib/sx/plugins/lib/gluster/__init__.py
RefactoringTool: No changes to ./lib/sx/plugins/lib/general/runlevelserviceparser.py
RefactoringTool: No changes to ./lib/sx/plugins/lib/general/processparser.py
RefactoringTool: Refactored ./lib/sx/plugins/lib/general/dmidecodeparser.py
RefactoringTool: No changes to ./lib/sx/plugins/lib/general/distroreleaseparser.py
RefactoringTool: No changes to ./lib/sx/plugins/lib/general/__init__.py
RefactoringTool: Refactored ./lib/sx/plugins/lib/clusterha/clusternodes.py
s()) + list(bondingMap.items()))
         # Get all the data in the sos_commands/networking directory.
         networkingCommandsMap = report.getDataFromDir("sos_commands/networking")
         # Build networkmaps from all the network related information.
@@ -131,7 +131,7 @@
         gpnUUID = glusterdInfoData[0].split("=")[1]
         gpnPeersMap = report.getDataFromDir("%s/peers" %(glusterRootDir))
         listOfPeerNodes = []
-        for key in gpnPeersMap.keys():
+        for key in list(gpnPeersMap.keys()):
             configFileParser = ConfigurationFileParser(gpnPeersMap.get(key), {}, enforceEmptyValues=False)
             gpnPeerMap = configFileParser.getMap()
             listOfPeerNodes.append(gpnPeerMap)
--- ./lib/sx/plugins/lib/general/dmidecodeparser.py	(original)
+++ ./lib/sx/plugins/lib/general/dmidecodeparser.py	(refactored)
@@ -71,7 +71,7 @@
 
     def __str__(self):
         rString = "handle: %s(type: %d bytes: %d): %s\n" %(self.getHandle(), self.getType(), self.getSize(), self.getName())
-        for attributeName in self.__attributesMap.keys():
+        for attributeName in list(self.__attributesMap.keys()):
             rString += "\t%s\n" %(self.__attributesMap.get(attributeName))
         return rString.rstrip()
 
@@ -88,9 +88,9 @@
         return self.__name
 
     def getAttributeNames(self):
-        return self.__attributesMap.keys()
+        return list(self.__attributesMap.keys())
 
     def getAttribute(self, attributeName):
-        if (self.__attributesMap.has_key(attributeName)):
+        if (attributeName in self.__attributesMap):
             return self.__attributesMap.get(attributeName)
         return None
--- ./lib/sx/plugins/lib/clusterha/clusternodes.py	(original)
+++ ./lib/sx/plugins/lib/clusterha/clusternodes.py	(refactored)
@@ -73,7 +73,7 @@
         # cman_tool_status file. All the keys have to be in file or it
         # will return None when parsed.
         cmanToolStatusCommand = None
-        if (clusterCommandsMap.has_key("cman_tool_status")):
+        if ("cman_tool_status" in clusterCommandsMap):
             cmanToolStatusCommand = ClusterCommandsParser.parseCmanToolStatusData(clusterCommandsMap.get("cman_tool_status"))
             if (not cmanToolStatusCommand == None):
                 # For now we will just get the first address returned.
@@ -204,7 +204,7 @@
             if ((fs.getFSType().lower() == "gfs") or
                 (fs.getFSType().lower() == "gfs2")):
                 key = fs.getMountPoint()
-                if (not csFSMap.has_key(key)):
+                if (key not in csFSMap):
                     csFSMap[key] = ClusterStorageFilesystem(fs.getDeviceName(),
                                                             fs.getMountPoint(),
                                                             fs.getFSType(),
@@ -216,7 +216,7 @@
             if ((fs.getFSType().lower() == "gfs") or
                 (fs.getFSType().lower() == "gfs2")):
                 key = fs.getMountPoint()
-                if (not csFSMap.has_key(key)):
+                if (key not in csFSMap):
                     csFSMap[key] = ClusterStorageFilesystem(fs.getDeviceName(),
                                                             fs.getMountPoint(),
                                                             fs.getFSType(),
@@ -228,7 +228,7 @@
             cca = ClusterHAConfAnalyzer(pathToClusterConf)
             for fs in cca.getClusterFilesystemResourcesList():
                 key = fs.getMountPoint()
-                if (not csFSMap.has_key(key)):
+                if (key not in csFSMap):
                     csFSMap[key] = ClusterStorageFilesystem(fs.getDeviceName(),
                                                             fs.getMountPoint(),
                                                             fs.getFSType(),
@@ -239,8 +239,8 @@
         # Search nfs/smb configuration files for GFS/GFS2 file-systems
         for etcExport in etcExportsList:
             pathToDir = etcExport.getMountPoint()
-            pathToFS = self.__findFSMatch(csFSMap.keys()RefactoringTool: Refactored ./lib/sx/plugins/lib/clusterha/clusternodecompare.py
, pathToDir)
-            if ((len(pathToFS) > 0) and (csFSMap.has_key(pathToFS))):
+            pathToFS = self.__findFSMatch(list(csFSMap.keys()), pathToDir)
+            if ((len(pathToFS) > 0) and (pathToFS in csFSMap)):
                 fs = csFSMap.get(pathToFS)
                 # There can be only 1 fs export line. So we will use the first
                 # one we get.
@@ -248,29 +248,29 @@
 
         for smbSection in etcSambaSectionsList:
             pathToDir = smbSection.getOptionValue("path")
-            pathToFS = self.__findFSMatch(csFSMap.keys(), pathToDir)
-            if ((len(pathToFS) > 0) and (csFSMap.has_key(pathToFS))):
+            pathToFS = self.__findFSMatch(list(csFSMap.keys()), pathToDir)
+            if ((len(pathToFS) > 0) and (pathToFS in csFSMap)):
                 fs = csFSMap.get(pathToFS)
                 fs.addSMBSectionMount(smbSection)
 
         # Iterate over the map to see if any GFS/GFS2 fs are present.
-        for key in etcClusterSambaSectionsListMap.keys():
+        for key in list(etcClusterSambaSectionsListMap.keys()):
             clusterSMBSectionsList = etcClusterSambaSectionsListMap.get(key)
             for smbSection in clusterSMBSectionsList:
                 pathToDir = smbSection.getOptionValue("path")
                 #print pathToDir
-                pathToFS = self.__findFSMatch(csFSMap.keys(), pathToDir)
-                if ((len(pathToFS) > 0) and (csFSMap.has_key(pathToFS))):
+                pathToFS = self.__findFSMatch(list(csFSMap.keys()), pathToDir)
+                if ((len(pathToFS) > 0) and (pathToFS in csFSMap)):
                     fs = csFSMap.get(pathToFS)
                     fs.addClusteredSMBSection(key, smbSection)
         # Return all the ClusterStorageFilesystem objects
-        return csFSMap.values()
+        return list(csFSMap.values())
 
     # #######################################################################
     # Public helper methods for functions
     # #######################################################################
     def getStorageData(self, clusternodeName):
-        if(self.__clusternodesStorageDataMap.has_key(clusternodeName)):
+        if(clusternodeName in self.__clusternodesStorageDataMap):
             return self.__clusternodesStorageDataMap.get(clusternodeName)
         return None
 
@@ -436,7 +436,7 @@
         # Get all the data from proc/net including the bonding data.
         procNetMap = report.getDataFromDir("proc/net")
         bondingMap = report.getDataFromDir("proc/net/bonding")
-        procNetMap = dict(procNetMap.items() + bondingMap.items())
+        procNetMap = dict(list(procNetMap.items()) + list(bondingMap.items()))
         # Get all the data in the sos_commands/networking directory.
         networkingCommandsMap = report.getDataFromDir("sos_commands/networking")
         # Build networkmaps from all the network related information.
@@ -486,7 +486,7 @@
         etcSambaSectionsList = FilesysParser.parseEtcSambaSmbConfData(report.getDataFromFile("etc/samba/smb.conf"))
         etcClusterSambaDataMap = report.getDataFromDir("etc/cluster/samba/*")
         etcClusterSambaSectionsListMap = {}
-        for key in etcClusterSambaDataMap.keys():
+        for key in list(etcClusterSambaDataMap.keys()):
             sambaSectionList = FilesysParser.parseEtcSambaSmbConfData(etcClusterSambaDataMap.get(key))
             if (len(sambaSectionList) > 0):
                 etcClusterSambaSectionsListMap[key] = sambaSectionList
@@ -630,7 +630,7 @@
 
             # Verify cluster packages
             packages = clusternode.getClusterPackagesVersion()
-            keys = packages.keys()
+            keys = list(packages.keys())
             keys.sort()
             index = 0
             fsTable  = []
@@ -660,7 +660,7 @@
 
             # Verify cluster-storage package
             packages = clusternode.getClusterModulePackagesVersion()
-            keys = packages.keys()
+            keys = list(packages.keys())
             keys.sort()
             index = 0
             fsTable  = []
--- ./lib/sx/plugins/lib/clusterha/clusternodecompare.py	(original)
+++ ./lib/sx/plugins/lib/clusterha/clusternodecompare.py	(refactored)
@@ -45,7 +45,7 @@
         # If all the reports had the same size then the size of the
         # map should be 1. Else there was no reports compared or there
         # was a mismatch so multiple keys created.
-        return (len(self.__compareMap.keys()) == 1)
+        return (len(list(self.__compareMap.keys())) == 1)
 
     def __getCompareValueCountTuples(self, compareMap):
         # Get the items that are not equal to the majority of
@@ -53,9 +53,9 @@
         # with same value count that is the highest and there is no
         # way to tell which is diff so none of those returned.
         compareValueCountMap = {}
-        for key in compareMap.keys():
+        for key in list(compareMap.keys()):
             compareValueCountMap[key] = len(compareMap.get(key))
-        sortedTuples = sorted(compareValueCountMap.iteritems(), key=operator.itemgetter(1))
+        sortedTuples = sorted(iter(compareValueCountMap.items()), key=operator.itemgetter(1))
         return sortedTuples
 
     def getNonBaseCompareMap(self):
@@ -70,7 +70,7 @@
                 currentCountValue = cTuple[1]
                 if (currentCountValue < maxCountValue):
                     valueCopy = deepcopy(self.__compareMap.get(currentCountKey))
-                    if (rMap.has_key(currentCountKey)):
+                    if (currentCountKey in rMap):
                         rMap[currentCountKey].append(valueCopy)
                     else:
                         rMap[currentCountKey] = valueCopy
@@ -87,7 +87,7 @@
             currentCountValue = cTuple[1]
             if (currentCountValue >= maxCountValue):
                 valueCopy = deepcopy(self.__compareMap.get(currentCountKey))
-                if (rMap.has_key(currentCountKey)):
+                if (currentCountKey in rMap):
                     rMap[currentCountKey].append(valueCopy)
                 else:
                     rMap[currentCountKey] = valueCopy
@@ -97,7 +97,7 @@
 
     def add(self, compareString, reportName):
         if ((len(compareString) > 0) and (len(reportName) > 0)):
-            if (self.__compareMap.has_key(compareString)):
+            if (compareString in self.__compareMap):
                 self.__compareMap[compareString].append(reportName)
             else:
                 self.__compareMap[compareString] = [reportName]
@@ -135,17 +135,17 @@
         # with same value count that is the highest and there is no
         # way to tell which is diff so none of those returned.
         compareValueCountMap = {}
-        for key in compareMap.keys():
+        for key in list(compareMap.keys()):
             compareValueCountMap[key] = len(compareMap.get(key))
-        sortedTuples = sorted(compareValueCountMap.iteritems(), key=operator.itemgetter(1))
+        sortedTuples = sorted(iter(compareValueCountMap.items()), key=operator.itemgetter(1))
         return sortedTuples
 
     def isIdentical(self):
         numberOfReports = len(self.__listOfReportNames)
-        for packageName in self.__compareMap.keys():
+        for packageName in list(self.__compareMap.keys()):
             packageMap = self.__compareMap.get(packageName)
-            if (len(packageMap.keys()) == 1):
-                if (not len(packageMap.items()[0][1]) == numberOfReports):
+            if (len(list(packageMap.keys())) == 1):
+                if (not len(list(packageMap.items())[0][1]) == numberOfReports):
                     # If there is only 1 package version found and if
                     # all the reports are not listed here then one of
                     # the reports does not have package installed.
@@ -157,10 +157,10 @@
 
     def getMissingPackagesMap(self):
         compareMap = {}
-        for packageName in self.__compareMap.keys():
+        for packageName in list(self.__compareMap.keys()):
             packageMap = self.__compareMap.get(packageName)
             currentReports = []
-            for key in packageMap.keys():
+            for key in list(packageMap.keys()):
                 currentReports += packageMap.get(key)
             diffList = list(set(self.__listOfReportNames).difference(set(currentReports)))
             if (len(diffList) > 0):
@@ -169,7 +169,7 @@
 
     def getDiffernetPackagesVersionMap(self):
         compareMap = {}
-        for packageName in self.__compareMap.keys():
+        for packageName in list(self.__compareMap.keys()):
             packageMap = self.__compareMap.get(packageName)
             currentReports = []
             compareValueCountTuples = self.__getCompareValueCountTuples(packageMap)
@@ -180,7 +180,7 @@
                 currentCountValue = cTuple[1]
                 if (currentCountValue < maxCountValue):
                     valueCopy = deepcopy(packageMap.get(currentCountKey))
-                    if (compareMap.has_key(currentCountKey)):
+                    if (currentCountKey in compareMap):
                         compareMap[currentCountKey].append(valueCopy)
                     else:
                         compareMap[currentCountKey] = valueCopy
@@ -189,17 +189,17 @@
     def add(self, installedRPMSMap, reportName):
         # Example:
         # openais -> {'openais-0.80.6-28.el5.x86_64': ['rh5node1.examplerh.com', 'rh5node2.examplerh.com', 'rh5node3.examplerh.com']}
-        if ((len(installedRPMSMap.keys()) > 0) and (len(reportName) > 0) and
+        if ((len(list(installedRPMSMap.keys())) > 0) and (len(reportName) > 0) and
             (not reportName in self.__listOfReportNames)):
             # Add the report name in so no duplicates and keep track
             # of the number of package lists we are comparing.
             self.__listOfReportNames.append(reportName)
-            for packageName in installedRPMSMap.keys():
+            for packageName in list(installedRPMSMap.keys()):
                 fullPackageName = installedRPMSMap.get(packageName)[0]
-                if (not self.__compareMap.has_key(packageName)):
+                if (packageName not in self.__compareMap):
                     self.__compareMap[packageName] = {}
                 packageMap = self.__compareMap.get(packageName)
-                if (packageMap.has_key(fullPackageName)):
+                if (fullPackageName in packageMap):
                     packageMap.get(fullPackageName).append(reportName)
                 else:
                     packageMap[fullPackageName] = [reportName]
@@ -220,11 +220,11 @@
         stringUtil = StringUtil()
         rString = ""
         nonBaseCompareMap = compareData.getNonBaseCompareMap()
-        if (not len(nonBaseCompareMap.keys()) > 0):
+        if (not len(list(nonBaseCompareMap.keys())) > 0):
             return rString
         description = "The following hosts had similar compared values:"
         baseCompareMap = compareData.getBaseCompareMap()
-        keys = baseCompareMap.keys()
+        keys = list(baseCompareMap.keys())
         keys.sort()
         compareTable = []
         for key in keys:
@@ -239,7 +239,7 @@
         rString += StringUtil.formatBulletString(description, [], tableOfStrings)
 
         description = "The following hosts had different compared values than the above compared values:"
-        keys = nonBaseCompareMap.keys()
+        keys = list(nonBaseCompareMap.keys())
         keys.sort()
         compareTable = []
         for key in keys:
@@ -261,9 +261,9 @@
         stringUtil = StringUtil()
         rString = ""
         missingPackagesMap = comparePackages.getMissingPackagesMap()
-        if (len(missingPackagesMap.keys()) > 0):
+        if (len(list(missingPackagesMap.keys())) > 0):
             description = "The following hosts did not have certain cluster packages installed(whereas other hosts did have the packages installed):"
-            keys = missingPackagesMap.keys()
+            keys = list(missingPackagesMap.keys())
             keys.sort()
             missingPackagesTable = []
             for key in keys:
@@ -279,9 +279,9 @@
             rString += StringUtil.formatBulletString(description, [], tableOfStrings)
 
    RefactoringTool: Refactored ./lib/sx/plugins/lib/clusterha/clusternode.py
RefactoringTool: No changes to ./lib/sx/plugins/lib/clusterha/clusterhastretchevaluator.py
RefactoringTool: Refactored ./lib/sx/plugins/lib/clusterha/clusterhastorage.py
     differentPackagesVersionMap = comparePackages.getDiffernetPackagesVersionMap()
-        if (len(differentPackagesVersionMap.keys()) > 0):
+        if (len(list(differentPackagesVersionMap.keys())) > 0):
             description = "The following hosts had a different package version installed:"
-            keys = differentPackagesVersionMap.keys()
+            keys = list(differentPackagesVersionMap.keys())
             keys.sort()
             differentPackageVersionsTable = []
             for key in keys:
--- ./lib/sx/plugins/lib/clusterha/clusternode.py	(original)
+++ ./lib/sx/plugins/lib/clusterha/clusternode.py	(refactored)
@@ -80,10 +80,10 @@
         return self.__smbSectionList
 
     def getClusteredSMBNames(self):
-        return self.__smbClusteredSectionsMap.keys()
+        return list(self.__smbClusteredSectionsMap.keys())
 
     def getClusteredSMBSectionList(self, name):
-        if (self.__smbClusteredSectionsMap.has_key(name)):
+        if (name in self.__smbClusteredSectionsMap):
             return self.__smbClusteredSectionsMap.get(name)
         return []
 
@@ -114,7 +114,7 @@
 
     def addClusteredSMBSection(self, name, smbSection):
         # Overwrite existing list if it is already in map.
-        if (self.__smbClusteredSectionsMap.has_key(name)):
+        if (name in self.__smbClusteredSectionsMap):
             self.__smbSectionList = self.__smbClusteredSectionsMap.get(name)
         else:
             self.__smbClusteredSectionsMap[name]  = [smbSection]
@@ -410,7 +410,7 @@
     def isManualFencingEnabled(self) :
         cnp = self.getClusterNodeProperties()
         fenceDevicesDict = cnp.getFenceDevices()
-        for key in fenceDevicesDict.keys():
+        for key in list(fenceDevicesDict.keys()):
             for fenceDevice in fenceDevicesDict.get(key):
                 fenceAgent = fenceDevice.get("agent")
                 if(fenceAgent == "fence_manual"):
@@ -509,7 +509,7 @@
         if (not len(transportMode) > 0):
             distroRelease = self.getDistroRelease()
             if (distroRelease.getDistroName() == "RHEL"):
-                if (ClusterNode.RHEL_CLUSTER_DEFAULT_TRANSPORT_MODE.has_key(distroRelease.getMajorVersion())):
+                if (distroRelease.getMajorVersion() in ClusterNode.RHEL_CLUSTER_DEFAULT_TRANSPORT_MODE):
                     transportMode = ClusterNode.RHEL_CLUSTER_DEFAULT_TRANSPORT_MODE.get(distroRelease.getMajorVersion())
         return transportMode
 
@@ -524,7 +524,7 @@
         returned.
         @type key: String
         """
-        if (self.__clusterCommandsMap.has_key(key)):
+        if (key in self.__clusterCommandsMap):
             return self.__clusterCommandsMap.get(key)
         return ""
 
@@ -535,7 +535,7 @@
         @return: Returns an array of keys.
         @rtype: Array
         """
-        return self.__clusterCommandsMap.keys()
+        return list(self.__clusterCommandsMap.keys())
 
     def getClusterPackagesVersion(self) :
         """
@@ -649,7 +649,7 @@
             return chkConfigClusterServiceList
 
         for chkConfigItem in self.getChkConfigList():
-            for key in clusterServices.keys():
+            for key in list(clusterServices.keys()):
                 if (chkConfigItem.getName() == clusterServices.get(key)):
                     # Set the order so we know the correct start order
                     # of services.
--- ./lib/sx/plugins/lib/clusterha/clusterhastorage.py	(original)
+++ ./lib/sx/plugins/lib/clusterha/clusterhastorage.py	(refactored)
@@ -51,7 +51,7 @@
                     locationFound += "M"
                 if (fs.isClusterConfMount()):
                     locationFound += "C"
-                if (not fsMap.has_key(clusternodeName)):
+                if (clusternodeName not in fsMap):
                     fsMap[clusternodeName] = []
                 fsMap.get(clusternodeName).append([fs.getDeviceName(), fs.getMountPoint(), fs.getFSType(), locationFound])
         rString  = ""
@@ -59,7 +59,7 @@
         stringUtil = StringUtil()
         for clusternodeName in self.__cnc.getClRefactoringTool: Refactored ./lib/sx/plugins/lib/clusterha/clusterhaconfanalyzer.py
usterNodeNames():
             # In the future I should probably add a way to only print once if they are all the same .
-            if (fsMap.has_key(clusternodeName)):
+            if (clusternodeName in fsMap):
                 listOfFileystems = fsMap.get(clusternodeName)
                 if (len(listOfFileystems) > 0):
                     tableString = "%s(%d mounted GFS or GFS2 file-systems)\n%s\n\n" %(clusternodeName, len(listOfFileystems), stringUtil.toTableString(listOfFileystems, fsListHeader))
--- ./lib/sx/plugins/lib/clusterha/clusterhaconfanalyzer.py	(original)
+++ ./lib/sx/plugins/lib/clusterha/clusterhaconfanalyzer.py	(refactored)
@@ -38,7 +38,7 @@
     def __str__(self):
         header = "quorum disk: "
         rString = ""
-        keys = self.__quorumdAttributes.keys()
+        keys = list(self.__quorumdAttributes.keys())
         keys.sort()
         lineIsSplit = False
         for key in keys:
@@ -76,7 +76,7 @@
             return ""
 
     def attributeExist(self, name):
-        if (self.__quorumdAttributes.has_key(name)):
+        if (name in self.__quorumdAttributes):
             return True
         return False
 
@@ -190,13 +190,13 @@
         # The default interval is determined by the qdiskd timeout. Not sure how
         # to get that. By default I will set to -1.
         self.__tko = "-1"
-        if (heuristicAttributes.has_key("program")):
+        if ("program" in heuristicAttributes):
            self.__program = heuristicAttributes.get("program")
-        if (heuristicAttributes.has_key("interval")):
+        if ("interval" in heuristicAttributes):
             self.__interval = heuristicAttributes.get("interval")
-        if (heuristicAttributes.has_key("score")):
+        if ("score" in heuristicAttributes):
             self.__score = heuristicAttributes.get("score")
-        if (heuristicAttributes.has_key("tko")):
+        if ("tko" in heuristicAttributes):
             self.__tko = heuristicAttributes.get("tko")
 
     def __str__(self):
@@ -268,7 +268,7 @@
     def __str__(self):
         rString = "%s(ordered = %s | restricted = %s)\n" %(self.getName(), str(self.isOrdered()), str(self.isRestricted()))
         fdMap = self.getFailoverDomainMembersMap()
-        keys = fdMap.keys()
+        keys = list(fdMap.keys())
         for key in keys:
             rString += "\t%s(priority: %s)\n" %(key, fdMap.get(key))
         return rString
@@ -308,10 +308,10 @@
         return self.__attributesMap
 
     def getAttributeNames(self):
-        return self.__attributesMap.keys()
+        return list(self.__attributesMap.keys())
 
     def getAttribute(self, attributeName):
-        if (self.__attributesMap.has_key(attributeName)):
+        if (attributeName in self.__attributesMap):
             return self.__attributesMap.get(attributeName)
         return ""
 
@@ -1237,7 +1237,7 @@
         # first item in list is attribute name and second item is attribute
         # value.
         # [('name', 'halvmVol1'), ('vg_name', 'VolGroupX'), ('lv_name', 'vol01')]
-        attributesPairList = resourceElement.items()
+        attributesPairList = list(resourceElement.items())
         # Now will create a map of the attributes.
         attributesMap = {}
         for attributePair in attributesPairList:
@@ -1320,9 +1320,9 @@
             clusteredResource = self.__getClusteredResource(resourceElement, False)
             if (not clusteredResource == None):
                 key = "%s-%s" %(clusteredResource.getType(), clusteredResource.getName())
-                if (not sharedResourceMap.has_key(key)):
+                if (key not in sharedResourceMap):
                     sharedResourceMap[key] = clusteredResource
-        return sharedResourceMap.values()
+        return list(sharedResourceMap.values())
 
     def getClusteredServices(self) :
         failoverDomainsList = self.getFailoverDomains()
@@ -1341,7 +1341,7 @@
                     except KeyError:
                         pass
                     # Build the Service.
-                    if (not servicesMap.has_key(name)):
RefactoringTool: Refactored ./lib/sx/plugins/lib/clusterha/clusterevaluator.py
RefactoringTool: Refactored ./lib/sx/plugins/lib/clusterha/clustercommandsparser.py
+                    if (name not in servicesMap):
                         level = 1
                         order = 1
                         listOfClusteredResourcesinService = []
@@ -1365,7 +1365,7 @@
                 except KeyError:
                     pass
                 servicesMap[name] = ClusteredService(name, recovery, failoverDomain, [], True)
-        return servicesMap.values()
+        return list(servicesMap.values())
 
     def getQuorumdSummary(self):
         quorumd = self.getQuorumd()
--- ./lib/sx/plugins/lib/clusterha/clusterevaluator.py	(original)
+++ ./lib/sx/plugins/lib/clusterha/clusterevaluator.py	(refactored)
@@ -187,7 +187,7 @@
                                     description = ""
                             if ((not len(evaluationMap.get("03-pacemakerRPMSInstalled")) > 0) and (len(description) > 0)):
                                 evaluationMap["03-pacemakerRPMSInstalledNoFenceAgent"] = StringUtil.formatBulletString(description, [])
-        keys = evaluationMap.keys()
+        keys = list(evaluationMap.keys())
         keys.sort()
         for key in keys:
             if (len(evaluationMap.get(key)) > 0):
@@ -225,7 +225,7 @@
                 stringUtil = StringUtil()
                 fenceEvaluationsMap["fence_vmware"] = StringUtil.formatBulletString(description, urls)
             # Make sure there is secondary fence device configured.
-            if (not len(list(set(map(lambda m: m.getMethodName(), cnFenceDeviceList)))) > 1):
+            if (not len(list(set([m.getMethodName() for m in cnFenceDeviceList]))) > 1):
                 description = "One or more cluster nodes did not have a secondary fence device. A secondary fence device is recommended on all cluster nodes."
                 urls = ["https://access.redhat.com/site/solutions/15575" , "https://access.redhat.com/site/solutions/16657"]
                 stringUtil = StringUtil()
@@ -249,7 +249,7 @@
                     fenceEvaluationsMap["fence_unfence_invalid"] = StringUtil.formatBulletString(description, urls)
         # Build the evaluation string that will be returned.
         rString = ""
-        for key in fenceEvaluationsMap.keys():
+        for key in list(fenceEvaluationsMap.keys()):
             rString += fenceEvaluationsMap.get(key)
         return rString.rstrip()
 
@@ -749,10 +749,10 @@
             # Verify that lvm an lvm2-cluster are same major and minor version.
             # ###################################################################
             lvm2PackageMap = RPMUtils.getPackageVersion(clusternode.getInstalledRPMS(), ["lvm2", "lvm2-cluster"])
-            if (lvm2PackageMap.has_key("lvm2-cluster")):
+            if ("lvm2-cluster" in lvm2PackageMap):
                 lvm2clusterPackage = lvm2PackageMap.get("lvm2-cluster")[0]
                 # Dont going to handle lvm2 not found cause that is highly unlikely.
-                if (lvm2PackageMap.has_key("lvm2")):
+                if ("lvm2" in lvm2PackageMap):
                     lvm2Package = lvm2PackageMap.get("lvm2")[0]
                     lvm2clusterVersion = lvm2clusterPackage.replace("lvm2-cluster-", "").split(".el5")[0].split("-")[0].strip()
                     lvm2Version = lvm2Package.replace("lvm2-", "").split(".el5")[0].split("-")[0].strip()
--- ./lib/sx/plugins/lib/clusterha/clustercommandsparser.py	(original)
+++ ./lib/sx/plugins/lib/clusterha/clustercommandsparser.py	(refactored)
@@ -39,11 +39,11 @@
             if mo:
                 label = mo.group("label").strip()
                 value = mo.group("value").strip()
-                for key in cmanToolStatusLabelMap.keys():
+                for key in list(cmanToolStatusLabelMap.keys()):
                     if (cmanToolStatusLabelMap.get(key) == label):
                         cmanToolStatusValuesMap[key] = value
 
-        if (len(cmanToolStatusLabelMap.keys()) == len(cmanToolStatusValuesMap)):
+        if (len(list(cmanToolStatusLabelMap.keys())) == len(cmanToolStatusValuesMap)):
             return CmanToolStatusCommand(cmanToolStatusValuesMap.get("version"), cmRefactoringTool: No changes to ./lib/sx/plugins/lib/clusterha/__init__.py
RefactoringTool: No changes to ./lib/sx/plugins/lib/__init__.py
RefactoringTool: Refactored ./lib/sx/plugins/gluster.py
RefactoringTool: Refactored ./lib/sx/plugins/clusterha.py
anToolStatusValuesMap.get("configVersion"),
                                          cmanToolStatusValuesMap.get("clusterName"), cmanToolStatusValuesMap.get("clusterID"),
                                          cmanToolStatusValuesMap.get("clusterMember"), cmanToolStatusValuesMap.get("clusterGeneration"),
@@ -84,7 +84,7 @@
                 memberIDMap[memberName] = mo.group("id").strip().rstrip()
                 memberStatusMap[memberName] = mo.group("status").strip().rstrip()
             elif (line.startswith("Service Name")):
-                members = memberIDMap.keys()
+                members = list(memberIDMap.keys())
                 membersString = ""
                 for member in members:
                     if (not member.startswith("/")):
@@ -112,19 +112,19 @@
         self.__serviceStateMap = serviceStateMap
 
     def getMembers(self):
-        return self.__memberIDMap.keys()
+        return list(self.__memberIDMap.keys())
 
     def getServices(self):
-        return self.__serviceOwnerMap.keys()
+        return list(self.__serviceOwnerMap.keys())
 
     def getMemberID(self, memberName):
-        if (self.__memberIDMap.has_key(memberName)):
+        if (memberName in self.__memberIDMap):
             return self.__memberIDMap.get(memberName)
         return ""
 
     def getMemberStatus(self, memberName):
         # Need a isOffline isOnline function
-        if (self.__memberStatusMap.has_key(memberName)):
+        if (memberName in self.__memberStatusMap):
             return self.__memberStatusMap.get(memberName)
         return ""
 
@@ -133,25 +133,25 @@
         return (memberStatus.find("Quorum Disk") > 0)
 
     def findQuorumDisk(self):
-        for member in self.__memberStatusMap.keys():
+        for member in list(self.__memberStatusMap.keys()):
             if (self.isOwnerQuorumDisk(member)):
                 return member
         return ""
 
     def getServiceOwner(self, serviceName):
         # Need to grep out last owner and no owner
-        if (self.__serviceOwnerMap.has_key(serviceName)):
+        if (serviceName in self.__serviceOwnerMap):
             return self.__serviceOwnerMap.get(serviceName)
         return ""
 
     def getServiceLastOwner(self, serviceName):
         # Need to grep out owner and no owner
-        if (self.__serviceOwnerMap.has_key(serviceName)):
+        if (serviceName in self.__serviceOwnerMap):
             return self.__serviceOwnerMap.get(serviceName)
         return ""
 
     def getServiceState(self, serviceName):
-        if (self.__serviceStateMap.has_key(serviceName)):
+        if (serviceName in self.__serviceStateMap):
             return self.__serviceStateMap.get(serviceName)
         return ""
 
--- ./lib/sx/plugins/gluster.py	(original)
+++ ./lib/sx/plugins/gluster.py	(refactored)
@@ -116,13 +116,13 @@
             pTable = []
             for peerNodeMap in glusterPeerNode.getPeerNodes():
                 pnHostname1 = ""
-                if (peerNodeMap.has_key("hostname1")):
+                if ("hostname1" in peerNodeMap):
                     pnHostname1 = peerNodeMap.get("hostname1")
                 pnUUID = ""
-                if (peerNodeMap.has_key("uuid")):
+                if ("uuid" in peerNodeMap):
                     pnUUID = peerNodeMap.get("uuid")
                 pnState = ""
-                if (peerNodeMap.has_key("state")):
+                if ("state" in peerNodeMap):
                     pnState = peerNodeMap.get("state")
                 pTable.append([pnHostname1, pnUUID, pnState])
             if (len(pTable) > 0):
--- ./lib/sx/plugins/clusterha.py	(original)
+++ ./lib/sx/plugins/clusterha.py	(refactored)
@@ -89,7 +89,7 @@
                 cca = ClusterHAConfAnalyzer(pathToClusterConfFile)
                 clusterName = cca.getClusterName()
                 if (len(clusterName) > 0):
-                    if (not self.__clusterMap.has_key(clusterName)):
+                    if (clusterName not in self.__clusterMap):
                         self.__clusterMap[clusterName] = ClusterNodes()
                     rRefactoringTool: Refactored ./lib/sx/plugins/checksysreport.py
RefactoringTool: Refactored ./lib/sx/plugins/__init__.py
esult = self.__clusterMap.get(clusterName).add(report)
 
@@ -98,7 +98,7 @@
         This function will write to report files the results of the
         cluster validation tests and report any errors to console.
         """
-        if (not len(self.__clusterMap.keys()) > 0):
+        if (not len(list(self.__clusterMap.keys())) > 0):
             message = "There were no cluster nodes found in the list of reports so no report will be generated."
             logging.getLogger(sx.MAIN_LOGGER_NAME).warn(message)
         else:
@@ -112,7 +112,7 @@
             # all the existing files.
             self.clean()
 
-            for clusterName in self.__clusterMap.keys():
+            for clusterName in list(self.__clusterMap.keys()):
                 message = "Analyzing and writing the report for the cluster: %s" %(clusterName)
                 logging.getLogger(sx.MAIN_LOGGER_NAME).status(message)
                 cnc = self.__clusterMap.get(clusterName)
@@ -186,7 +186,7 @@
                 chkConfigClusterServiceList = clusternode.getChkConfigClusterServicesStatus()
                 if (len(chkConfigClusterServiceList) > 0):
                     sortedChkConfigClusterServicesList = sorted(chkConfigClusterServiceList, key=lambda k: k.getStartOrderNumber())
-                    currentListOfServices = list(set(map(lambda m: m.getName(), sortedChkConfigClusterServicesList)))
+                    currentListOfServices = list(set([m.getName() for m in sortedChkConfigClusterServicesList]))
                     listOfServicesforClusterNodes = list(set(listOfServicesforClusterNodes) | set(currentListOfServices))
             # Just sort alpha and not worry with order.
             listOfServicesforClusterNodes.sort()
--- ./lib/sx/plugins/checksysreport.py	(original)
+++ ./lib/sx/plugins/checksysreport.py	(refactored)
@@ -136,7 +136,7 @@
                 fileInput = fileinput.input(pathToFile, inplace=True)
                 for line in fileInput:
                     if (line != '\n'):
-                        print line,
+                        print(line, end=' ')
                 fileInput.close()
             except IOError:
                 pass
@@ -189,7 +189,7 @@
             message = "There was no configuration file for checksysreport, please create the config file: %s." %(Checksysreport.CHEKCSYSREPORT_CONFIG_FILE)
             logging.getLogger(sx.MAIN_LOGGER_NAME).error(message)
             return
-        cKeys = self.__chksysData.keys()
+        cKeys = list(self.__chksysData.keys())
         cKeys.sort()
         for key in cKeys:
             # Make sure there is no danglying newlines at end of the
@@ -222,13 +222,13 @@
         """
         message = "Generating report for plugin: %s" %(self.getName())
         logging.getLogger(sx.MAIN_LOGGER_NAME).status(message)
-        if (len(self.__chksysData.keys()) > 0):
+        if (len(list(self.__chksysData.keys())) > 0):
             # Since we are going to run the plugin and create files in
             # the plugins report directory then we will first remove
             # all the existing files.
             self.clean()
 
-        for key in self.__chksysData.keys():
+        for key in list(self.__chksysData.keys()):
             if (len(self.__chksysData[key]) > 0):
                 (head, tail) = os.path.split(key)
                 # We will not append the data because we are only writing once.
--- ./lib/sx/plugins/__init__.py	(original)
+++ ./lib/sx/plugins/__init__.py	(refactored)
@@ -41,17 +41,17 @@
                 enabledMessage = "There was no plugins enabled."
             if (not len(disabledMessage) > 0):
                 disabledMessage = "There was no plugins disabled."
-            print  "\n%s\n%s" %(enabledMessage, disabledMessage)
-
-            print "The list of available options for plugins:"
+            print("\n%s\n%s" %(enabledMessage, disabledMessage))
+
+            print("The list of available options for plugins:")
             for plugin in loadedPlugins:
                 optionNames = plugin.getOptions()
                 if (len(optionNames) > 0):
                     for optionName in optionNames :
                         optionDescription = plugin.getOptionDescription(optionName)
-                        print "%s.%s: %s" %(ConsoleUtil.colorText(str(plugin.getName()),"red"),
+                        print("%s.%s: %s" %(ConsoleUtil.colorText(str(plugin.getName()),"red"),
                                             ConsoleUtil.colorText(optionName,"red"),
-                                            optionDescription)
+                                            optionDescription))
 
     def getEnabledPluginsList(self, pathToPluginReportDir, enableAllPlugins, disableAllPlugins,
                               listOfEnabledPlugins, listOfDisabledPlugins, pluginsOptionsMap,
@@ -98,11 +98,11 @@
                 # ###############################################################
                 # Map the options on the enabled plugins
                 pluginName = plugin.getName().lower()
-                if (pluginsOptionsMap.has_key(pluginName)):
+                if (pluginName in pluginsOptionsMap):
                     # Get a dictionary from a dictionary key whose
                     # value is a dictionary.
                     optionsMap = pluginsOptionsMap.get(pluginName)
-                    for optionName in optionsMap.keys():
+                    for optionName in list(optionsMap.keys()):
                         plugin.setOptionValue(optionName, optionsMap.get(optionName))
                         # Found the correct plugin so need to keep searching
                         continue
@@ -137,7 +137,7 @@
             listOfFiles = plugin.getFileList()
             if (len(listOfFiles) > 0) :
                 for filename in listOfFiles:
-                    if (not mapOfPluginReportPaths.has_key(plugin.getName())):
+                    if (plugin.getName() not in mapOfPluginReportPaths):
                         mapOfPluginReportPaths[plugin.getName()] = [filename]
                     else:
                         mapOfPluginReportPaths[plugin.getName()].append(filename)
@@ -200,7 +200,7 @@
         # The option values and description should have same set of
         # keys. Note new options cannot be added outside on __init__
         # or descriptions changed.
-        for key in self.__optionDescriptions.keys():
+        for key in list(self.__optionDescriptions.keys()):
             # Empty String is for no default value. Defaults can be
             # added in the __init__ of the plugin.
             self.__optionValues[key] = ""
@@ -299,7 +299,7 @@
         Dict.
         @rtype: Array
         """
-        return self.__optionDescriptions.keys()
+        return list(self.__optionDescriptions.keys())
 
     def getOptionDescription(self, optionName):
         """
@@ -309,7 +309,7 @@
         plugin option.  None is returned if optionName does not exist.
         @rtype: String
         """
-        if self.__optionDescriptions.has_key(optionName):
+        if optionName in self.__optionDescriptions:
             return self.__optionDescriptions[optionName]
         return None
 
@@ -321,7 +321,7 @@
         option. None is returned if optionName does not exist.
         @rtype:String
         """
-        if self.__optionValues.has_key(optionName):
+        if optionName in self.__optionValues:
             return self.__optionValues[optionName]
         return None
 
@@ -345,7 +345,7 @@
         be set.
         @type value: String
         """
-        if (self.__optionValues.has_key(optionName)) :
+        if (optionName in self.__optionValues) :
             self.__optionValues[optionName] = value
             return True
         return False
@@ -490,11 +490,11 @@
             fout = open(pathToFilename, filemode)
             fout.write(data + "\n")
             fout.close()
-        except UnicodeEncodeError, e:
+        except UnicodeEncodeError as e:
             # Python 2.6 has "as", 2.5 does not  except UnicodeEncodeError as e:
             message = "There was a unicode encode error on file: %s." %(filename)
          RefactoringTool: Refactored ./lib/sx/modulesloader.py
RefactoringTool: Refactored ./lib/sx/logwriter.py
RefactoringTool: No changes to ./lib/sx/extractors/zipextractor.py
RefactoringTool: No changes to ./lib/sx/extractors/tarextractor.py
RefactoringTool: No changes to ./lib/sx/extractors/__init__.py
RefactoringTool: Refactored ./doc/examples/konsole.py
RefactoringTool: No changes to ./doc/examples/demoreport.py
RefactoringTool: Refactored ./doc/examples/demoplugin.py
   logging.getLogger(sx.MAIN_LOGGER_NAME).error(message)
-            print e
+            print(e)
         except IOError:
             message = "There was an error writing the file: %s." %(filename)
             logging.getLogger(sx.MAIN_LOGGER_NAME).error(message)
--- ./lib/sx/modulesloader.py	(original)
+++ ./lib/sx/modulesloader.py	(refactored)
@@ -61,10 +61,10 @@
             return getattr(module, moduleClassName)
         except ValueError:
             pass
-        except ImportError,e:
+        except ImportError as e:
             message ="Import module error occurred on importing the Class \"%s\" from import: %s" %(moduleClassName, pathToModuleFile)
             logging.getLogger(sx.MAIN_LOGGER_NAME).error(message)
-            print e
+            print(e)
         return None
 
     def getClasses(self, pathToModuleBaseDir, moduleImportBase):
@@ -227,7 +227,7 @@
             for line in listOfFilenames:
                 mo = rem.match(line)
                 if mo:
-                    if (detectionFileMap.has_key(mo.lastgroup)):
+                    if (mo.lastgroup in detectionFileMap):
                         reportClass = detectionFileMap.get(mo.lastgroup)
                         report = reportClass()
                         return report
--- ./lib/sx/logwriter.py	(original)
+++ ./lib/sx/logwriter.py	(refactored)
@@ -176,7 +176,7 @@
         @param color: The color that text should be colorized to.
         @type color: String
         """
-        if (not StreamHandlerColorized.CONSOLE_COLORS.has_key(color)):
+        if (color not in StreamHandlerColorized.CONSOLE_COLORS):
             return text
         fgColor = StreamHandlerColorized.CONSOLE_COLORS.get(color)
         opencol = "\033["
--- ./doc/examples/konsole.py	(original)
+++ ./doc/examples/konsole.py	(refactored)
@@ -77,7 +77,7 @@
         logging.getLogger(sx.MAIN_LOGGER_NAME).info(message)
         try :
             bus = dbus.SessionBus()
-            for key in self.__pathToReports.keys():
+            for key in list(self.__pathToReports.keys()):
                 pathToReport = self.__pathToReports[key]
                 if (os.path.exists(pathToReport)):
                     try:
@@ -105,10 +105,10 @@
                         if (os.path.exists(pathToMessageFile)):
                             currentSessionInterface.sendText("%s %s\n" % (self.__fileViewerCommand, pathToMessageFile))
 
-                    except dbus.exceptions.DBusException, e:
+                    except dbus.exceptions.DBusException as e:
                         message = "An error occurred trying to communicate with dbus to create/modify a session."
                         logging.getLogger(sx.MAIN_LOGGER_NAME).error(message)
-                        print e
+                        print(e)
                 else:
                     message = "The report directory does not exist: %s" % (pathToReport)
                     logging.getLogger(sx.MAIN_LOGGER_NAME).error(message)
--- ./doc/examples/demoplugin.py	(original)
+++ ./doc/examples/demoplugin.py	(refactored)
@@ -144,9 +144,9 @@
         # #######################################################################
         # Write information gathered to console
         # #######################################################################
-        print "\t  This is the uptime information generated:"
-        for key in self.__uptime.keys() :
-            print "\t  %s: %s" %(key, self.__uptime[key])
+        print("\t  This is the uptime information generated:")
+        for key in list(self.__uptime.keys()) :
+            print("\t  %s: %s" %(key, self.__uptime[key]))
 
         # #######################################################################
         # Write information gathered to a report file.
@@ -157,7 +157,7 @@
         # Write a header
         self.writeSeperator(filename, "Demo Summary of Extracting Data");
         # Loop over all the data and write the informatio to a file.
-        for key in self.__etcHostsData.keys() :
+        for key in list(self.__etcHostsData.keys()) :
 RefactoringTool: Files that were modified:
RefactoringTool: ./sxconsole
RefactoringTool: ./setup.py
RefactoringTool: ./lib/sx/__init__.py
RefactoringTool: ./lib/sx/tools.py
RefactoringTool: ./lib/sx/reports/sysreport.py
RefactoringTool: ./lib/sx/reports/sosreport.py
RefactoringTool: ./lib/sx/reports/satellitedebug.py
RefactoringTool: ./lib/sx/reports/rhevlogcollector.py
RefactoringTool: ./lib/sx/reports/__init__.py
RefactoringTool: ./lib/sx/plugins/storage.py
RefactoringTool: ./lib/sx/plugins/satellitedebug.py
RefactoringTool: ./lib/sx/plugins/rhev.py
RefactoringTool: ./lib/sx/plugins/opensosreport.py
RefactoringTool: ./lib/sx/plugins/networking.py
RefactoringTool: ./lib/sx/plugins/lib/storage/storageevaluator.py
RefactoringTool: ./lib/sx/plugins/lib/storage/procparser.py
RefactoringTool: ./lib/sx/plugins/lib/storage/lvm.py
RefactoringTool: ./lib/sx/plugins/lib/storage/filesysparser.py
RefactoringTool: ./lib/sx/plugins/lib/storage/devicemapperparser.py
RefactoringTool: ./lib/sx/plugins/lib/storage/blockdevicetree.py
RefactoringTool: ./lib/sx/plugins/lib/storage/__init__.py
RefactoringTool: ./lib/sx/plugins/lib/rpm/rpmparser.py
RefactoringTool: ./lib/sx/plugins/lib/rpm/__init__.py
RefactoringTool: ./lib/sx/plugins/lib/networking/networkdeviceparser.py
RefactoringTool: ./lib/sx/plugins/lib/networking/__init__.py
RefactoringTool: ./lib/sx/plugins/lib/log/syslogparser.py
RefactoringTool: ./lib/sx/plugins/lib/log/__init__.py
RefactoringTool: ./lib/sx/plugins/lib/kernel/modulesparser.py
RefactoringTool: ./lib/sx/plugins/lib/kernel/__init__.py
RefactoringTool: ./lib/sx/plugins/lib/gluster/glusterpeernodes.py
RefactoringTool: ./lib/sx/plugins/lib/gluster/glusterpeernode.py
RefactoringTool: ./lib/sx/plugins/lib/gluster/__init__.py
RefactoringTool: ./lib/sx/plugins/lib/general/runlevelserviceparser.py
RefactoringTool: ./lib/sx/plugins/lib/general/processparser.py
RefactoringTool: ./lib/sx/plugins/lib/general/dmidecodeparser.py
RefactoringTool: ./lib/sx/plugins/lib/general/distroreleaseparser.py
RefactoringTool: ./lib/sx/plugins/lib/general/__init__.py
RefactoringTool: ./lib/sx/plugins/lib/clusterha/clusternodes.py
RefactoringTool: ./lib/sx/plugins/lib/clusterha/clusternodecompare.py
RefactoringTool: ./lib/sx/plugins/lib/clusterha/clusternode.py
RefactoringTool: ./lib/sx/plugins/lib/clusterha/clusterhastretchevaluator.py
RefactoringTool: ./lib/sx/plugins/lib/clusterha/clusterhastorage.py
RefactoringTool: ./lib/sx/plugins/lib/clusterha/clusterhaconfanalyzer.py
RefactoringTool: ./lib/sx/plugins/lib/clusterha/clusterevaluator.py
RefactoringTool: ./lib/sx/plugins/lib/clusterha/clustercommandsparser.py
RefactoringTool: ./lib/sx/plugins/lib/clusterha/__init__.py
RefactoringTool: ./lib/sx/plugins/lib/__init__.py
RefactoringTool: ./lib/sx/plugins/gluster.py
RefactoringTool: ./lib/sx/plugins/clusterha.py
RefactoringTool: ./lib/sx/plugins/checksysreport.py
RefactoringTool: ./lib/sx/plugins/__init__.py
RefactoringTool: ./lib/sx/modulesloader.py
RefactoringTool: ./lib/sx/logwriter.py
RefactoringTool: ./lib/sx/extractors/zipextractor.py
RefactoringTool: ./lib/sx/extractors/tarextractor.py
RefactoringTool: ./lib/sx/extractors/__init__.py
RefactoringTool: ./doc/examples/konsole.py
RefactoringTool: ./doc/examples/demoreport.py
RefactoringTool: ./doc/examples/demoplugin.py
            self.write(filename,  "%s:" %(key))
             for line in self.__etcHostsData[key]:
                 self.write(filename, "\t %s"%(line.strip()))
@@ -173,7 +173,7 @@
         # modify the orginal files.
         self.writeSeperator(filename, "Demo Summary of Extracting a Path");
         # Loop over all the data and write the informatio to a file.
-        for key in self.__pathToModprobeConf.keys() :
+        for key in list(self.__pathToModprobeConf.keys()) :
             self.write(filename,  "%s: \n\t  %s" %(key, self.__pathToModprobeConf[key]))
             self.write(filename, "")
 
+ exit 0
Executing(%build): /bin/sh -e /usr/src/tmp/rpm-tmp.61199
+ umask 022
+ /bin/mkdir -p /usr/src/RPM/BUILD
+ cd /usr/src/RPM/BUILD
+ cd sx-2.17
+ /usr/bin/python3 setup.py build
Traceback (most recent call last):
  File "/usr/src/RPM/BUILD/sx-2.17/setup.py", line 2, in <module>
    from distutils.core import setup
ModuleNotFoundError: No module named 'distutils'
error: Bad exit status from /usr/src/tmp/rpm-tmp.61199 (%build)


RPM build errors:
    Bad exit status from /usr/src/tmp/rpm-tmp.61199 (%build)
Command exited with non-zero status 1
4.59user 0.15system 0:04.77elapsed 99%CPU (0avgtext+0avgdata 31372maxresident)k
0inputs+0outputs (0major+29099minor)pagefaults 0swaps
hsh-rebuild: rebuild of `libsx-2.17-alt2.src.rpm' failed.
Command exited with non-zero status 1
3.78user 1.55system 0:13.08elapsed 40%CPU (0avgtext+0avgdata 125324maxresident)k
0inputs+0outputs (0major+269196minor)pagefaults 0swaps