diff options
author | Pavel Moravec <pmoravec@redhat.com> | 2019-02-07 11:42:00 +0100 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2019-03-20 15:57:20 +0000 |
commit | c6bf39dd21d250faf43ef04f01ac2d8d5bf8bc21 (patch) | |
tree | d2ff3f4d2c2910d9730a6d0448fe184c2c2b08e4 | |
parent | cfbf75bb36a170d9e62b6029104a3af51016cb58 (diff) | |
download | sos-c6bf39dd21d250faf43ef04f01ac2d8d5bf8bc21.tar.gz |
[iprconfig,sapnw] fix nested loops using same variable
Nested loops shall not use same variable name as their iterator.
Relevant to: #1559
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
-rw-r--r-- | sos/plugins/iprconfig.py | 6 | ||||
-rw-r--r-- | sos/plugins/sapnw.py | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/sos/plugins/iprconfig.py b/sos/plugins/iprconfig.py index 62f94213..23f131f5 100644 --- a/sos/plugins/iprconfig.py +++ b/sos/plugins/iprconfig.py @@ -101,9 +101,9 @@ class IprConfig(Plugin, RedHatPlugin, UbuntuPlugin, DebianPlugin): temp = re.split(r'\s+', line) # temp[1] holds the PCI/SCSI location pci, scsi = temp[1].split('/') - for line in altconfig['output'].splitlines(): - if scsi in line: - temp = line.split(' ') + for alt_line in altconfig['output'].splitlines(): + if scsi in alt_line: + temp = alt_line.split(' ') # temp[0] holds device name self.add_cmd_output("iprconfig -c " "query-ses-mode %s" % temp[0]) diff --git a/sos/plugins/sapnw.py b/sos/plugins/sapnw.py index 57363118..70f45602 100644 --- a/sos/plugins/sapnw.py +++ b/sos/plugins/sapnw.py @@ -38,9 +38,9 @@ class sapnw(Plugin, RedHatPlugin): # Cycle through all the instances, get 'sid', 'instance_number' # and 'vhost' to determine the proper profile p = open(inst_out, "r").read().splitlines() - for line in p: - if "DAA" not in line: - fields = line.strip().split() + for inst_line in p: + if "DAA" not in inst_line: + fields = inst_line.strip().split() sid = fields[3] inst = fields[5] vhost = fields[7] |