summaryrefslogtreecommitdiff
path: root/bin
diff options
authorAdrian Lane <adrian.lane@canonical.com>2020-04-26 23:13:32 -0700
committerAdrian Lane <adrian.lane@canonical.com>2020-04-26 23:13:32 -0700
commit756c7c2026245198fe94faa660dc1d41050327e4 (patch)
treeac1da08c443a56fc9caabd023affd7677deed5c2 /bin
parent83eab9d81a35e6aaca90777b796d2eb89778bdbb (diff)
Minor refactor of ipmi_channel().
Diffstat (limited to 'bin')
-rwxr-xr-xbin/ipmi_test.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/bin/ipmi_test.py b/bin/ipmi_test.py
index 02cba07..d8c34cf 100755
--- a/bin/ipmi_test.py
+++ b/bin/ipmi_test.py
@@ -219,8 +219,7 @@ class IpmiTest(object):
return 0
# ipmi_channel discovery loop
- def _ipmi_channel_hlpr(self, i, channel):
- regex = re.compile('Section User')
+ def _ipmi_channel_hlpr(self, i, regex, channel):
cmd = self._cmd_ipmi_channel
if (len(cmd) > 4):
cmd.pop(-1)
@@ -238,10 +237,11 @@ class IpmiTest(object):
logging.info('Fetching IPMI channels:')
# support multiple channels
channel = []
+ regex = re.compile('Section User')
# test channels 0 - 15
for i in range(16):
try:
- self._ipmi_channel_hlpr(i, channel)
+ self._ipmi_channel_hlpr(i, regex, channel)
except self._sub_proc_excs as exc:
self._proc_exc(exc, self.ipmi_channel.__qualname__)
return 1
@@ -324,9 +324,9 @@ def main():
results = ipmi_test.run_test()
results_dict = {'Chassis': results[0],
'Power': results[1],
- 'BMC': results[3],
- 'IPMI Version': results[4],
- 'Channel': results[2],
+ 'BMC': results[2],
+ 'IPMI Version': results[3],
+ 'Channel': results[4],
'IPMI Locate': results[5]}
# tally results
if (sum(results) > 0):