pycodestyle: fix issues
When calling pycodestyle directly on a file (vs the project as a
whole) it seems to be a bit more opinionated. Fix up these issues
so we can change how we call pycodestyle organization-wide.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: If561fb1ec3036b5fd5a600969fb5d81274464db2
diff --git a/bin/plug_ins/Stop/cp_stop_check b/bin/plug_ins/Stop/cp_stop_check
index ba46eb7..8eb8e05 100755
--- a/bin/plug_ins/Stop/cp_stop_check
+++ b/bin/plug_ins/Stop/cp_stop_check
@@ -4,6 +4,7 @@
Check for stop conditions. Return code of 2 if stop conditions are found.
"""
+import argparse
import sys
import subprocess
import os
@@ -30,18 +31,18 @@
# Create parser object to process command line parameters and args.
parser = argparse.ArgumentParser(
usage='%(prog)s [OPTIONS]',
- description="If the \"Stop\" plug-in is selected by the user, %(prog)s" +
- " is called by OBMC Boot Test after each boot test. If %(prog)s returns" +
- " " + str(stop_test_rc) + ", then OBMC Boot Test will stop. The user" +
- " may set environment variable STOP_COMMAND to contain any valid bash" +
- " command or program. %(prog)s will run this stop command. If the stop" +
- " command returns non-zero, then %(prog)s will return " +
- str(stop_test_rc) + ". %(prog)s recognizes some special values for" +
- " STOP_COMMAND: 1) \"FAIL\" means that OBMC Boot Test should stop" +
- " whenever a boot test fails. 2) \"ALL\" means that OBMC Boot Test" +
- " should stop after any boot test. If environment variable" +
- " STOP_REST_FAIL is set, OBMC Boot Test will stop if REST commands are" +
- " no longer working.",
+ description="If the \"Stop\" plug-in is selected by the user, %(prog)s"
+ + " is called by OBMC Boot Test after each boot test. If %(prog)s returns"
+ + " " + str(stop_test_rc) + ", then OBMC Boot Test will stop. The user"
+ + " may set environment variable STOP_COMMAND to contain any valid bash"
+ + " command or program. %(prog)s will run this stop command. If the stop"
+ + " command returns non-zero, then %(prog)s will return "
+ + str(stop_test_rc) + ". %(prog)s recognizes some special values for"
+ + " STOP_COMMAND: 1) \"FAIL\" means that OBMC Boot Test should stop"
+ + " whenever a boot test fails. 2) \"ALL\" means that OBMC Boot Test"
+ + " should stop after any boot test. If environment variable"
+ + " STOP_REST_FAIL is set, OBMC Boot Test will stop if REST commands are"
+ + " no longer working.",
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
prefix_chars='-+')
@@ -147,11 +148,11 @@
return
pel_txt_file_path = os.environ.get("AUTOBOOT_FFDC_DIR_PATH", "") + \
- os.environ.get("AUTOBOOT_FFDC_PREFIX", "") + "PEL_logs_list.json"
+ os.environ.get("AUTOBOOT_FFDC_PREFIX", "") + "PEL_logs_list.json"
if not os.path.isfile(pel_txt_file_path):
- qprint_timen("The following file was not present so no further" +
- " action will be taken.")
+ qprint_timen("The following file was not present so no further"
+ + " action will be taken.")
qprint_var(pel_txt_file_path)
return
@@ -170,22 +171,23 @@
pel_stop_list = file_to_list(pel_stop_file_path, newlines=0, comments=0)
if len(pel_stop_list) == 0:
- print_timen("There are no records to process in " +
- pel_stop_file_path + ".")
+ print_timen("There are no records to process in "
+ + pel_stop_file_path + ".")
return
pel_all_list = file_to_list(pel_txt_file_path, newlines=0, comments=0)
if len(pel_all_list) == 0:
- print_timen("There are no records to process in " +
- pel_txt_file_path + ".")
+ print_timen("There are no records to process in "
+ + pel_txt_file_path + ".")
return
for stop_pel in pel_stop_list:
for pel_all in pel_all_list:
pel_match = re.search(".*SRC.*" + stop_pel + ".*", pel_all)
if pel_match:
- print_timen("The caller wishes to stop test execution based on the presence of certain PEL entries.")
+ print_timen("The caller wishes to stop test execution based on "
+ + "the presence of certain PEL entries.")
stop_check()