diff options
author | Adrian Lane <adrian.lane@canonical.com> | 2020-04-03 14:36:17 -0700 |
---|---|---|
committer | Adrian Lane <adrian.lane@canonical.com> | 2020-04-03 14:36:17 -0700 |
commit | 6b149f98ffccd1fa5cb0ef96a458bacd697dae24 (patch) | |
tree | a7d207ddb78d939c3a4d86f447eacc1ba194a12e /bin | |
parent | 1ac18b3ddd710f652090f3b1a5cc694bc063f898 (diff) |
Refactored ipmi_channel(), minor syntax changes (last push till next feedback).
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/ipmi_test.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/bin/ipmi_test.py b/bin/ipmi_test.py index 2d6d8b2..e66ab20 100755 --- a/bin/ipmi_test.py +++ b/bin/ipmi_test.py @@ -71,7 +71,7 @@ class IpmiTest(object): process = Popen( cmd, stdout=PIPE, stderr=PIPE, universal_newlines=True) output, error = process.communicate(timeout=self.subproc_timeout) - logging.debug('\n## Debug Output: ##') + logging.debug('## Debug Output: ##') if len(output) > 0: # padding logging.debug(' [Stdout]\n') @@ -158,11 +158,13 @@ class IpmiTest(object): matches = 0 # support multiple channels channel = [] + cmd = [self.path_ipmi_config, '--checkout', + '--lan-channel-number', channel] # test channels 0 - 15 try: - for i in range(15): - cmd = [self.path_ipmi_config, '--checkout', - '--lan-channel-number', str(i)] + for i in range(16): + del cmd[(len(cmd) - 1)] + cmd.append(str(i)) output = self.subproc_logging(cmd) for line in output.rstrip().split('\n'): if re.search(regex, line): @@ -244,12 +246,11 @@ def main(): logger = logging.getLogger() logger.setLevel(logging.DEBUG) format = '' - date_format = '%Y-%m-%d %H:%M:%S' if not args.quiet: console_handler = logging.StreamHandler() console_handler.setFormatter( - logging.Formatter(format, date_format)) + logging.Formatter(format, )) console_handler.setLevel(logging.INFO) logger.addHandler(console_handler) |