Michael Walsh | 7423c01 | 2016-10-04 10:27:21 -0500 | [diff] [blame] | 1 | #!/usr/bin/env python |
| 2 | |
| 3 | import sys |
George Keishing | 36efbc0 | 2018-12-12 10:18:23 -0600 | [diff] [blame] | 4 | try: |
| 5 | import __builtin__ |
| 6 | except ImportError: |
| 7 | import builtins as __builtin__ |
Michael Walsh | 7423c01 | 2016-10-04 10:27:21 -0500 | [diff] [blame] | 8 | import subprocess |
| 9 | import os |
| 10 | import argparse |
| 11 | |
| 12 | # python puts the program's directory path in sys.path[0]. In other words, |
| 13 | # the user ordinarily has no way to override python's choice of a module from |
| 14 | # its own dir. We want to have that ability in our environment. However, we |
| 15 | # don't want to break any established python modules that depend on this |
| 16 | # behavior. So, we'll save the value from sys.path[0], delete it, import our |
| 17 | # modules and then restore sys.path to its original value. |
| 18 | |
| 19 | save_path_0 = sys.path[0] |
| 20 | del sys.path[0] |
| 21 | |
| 22 | from gen_print import * |
| 23 | from gen_valid import * |
| 24 | from gen_arg import * |
| 25 | from gen_plug_in import * |
Michael Walsh | 97d5b36 | 2017-05-30 17:57:38 -0500 | [diff] [blame] | 26 | from gen_cmd import * |
Michael Walsh | 8c5a8a8 | 2018-10-30 13:17:23 -0500 | [diff] [blame] | 27 | from gen_misc import * |
Michael Walsh | 7423c01 | 2016-10-04 10:27:21 -0500 | [diff] [blame] | 28 | |
| 29 | # Restore sys.path[0]. |
| 30 | sys.path.insert(0, save_path_0) |
Michael Walsh | 7423c01 | 2016-10-04 10:27:21 -0500 | [diff] [blame] | 31 | |
Michael Walsh | 7423c01 | 2016-10-04 10:27:21 -0500 | [diff] [blame] | 32 | # Create parser object to process command line parameters and args. |
| 33 | |
| 34 | # Create parser object. |
| 35 | parser = argparse.ArgumentParser( |
| 36 | usage='%(prog)s [OPTIONS]', |
Joy Onyerikwu | 004ad3c | 2018-06-11 16:29:56 -0500 | [diff] [blame] | 37 | description="%(prog)s will process the plug-in packages passed to it." |
| 38 | + " A plug-in package is essentially a directory containing" |
| 39 | + " one or more call point programs. Each of these call point" |
| 40 | + " programs must have a prefix of \"cp_\". When calling" |
| 41 | + " %(prog)s, a user must provide a call_point parameter" |
| 42 | + " (described below). For each plug-in package passed," |
| 43 | + " %(prog)s will check for the presence of the specified call" |
| 44 | + " point program in the plug-in directory. If it is found," |
| 45 | + " %(prog)s will run it. It is the responsibility of the" |
| 46 | + " caller to set any environment variables needed by the call" |
| 47 | + " point programs.\n\nAfter each call point program" |
| 48 | + " has been run, %(prog)s will print the following values in" |
| 49 | + " the following formats for use by the calling program:\n" |
| 50 | + " failed_plug_in_name: <failed plug-in value," |
| 51 | + " if any>\n shell_rc: " |
| 52 | + "<shell return code value of last call point program - this" |
| 53 | + " will be printed in hexadecimal format. Also, be aware" |
| 54 | + " that if a call point program returns a value it will be" |
| 55 | + " shifted left 2 bytes (e.g. rc of 2 will be printed as" |
| 56 | + " 0x00000200). That is because the rightmost byte is" |
| 57 | + " reserved for errors in calling the call point program" |
| 58 | + " rather than errors generated by the call point program.>", |
Michael Walsh | d0741f8 | 2017-12-21 14:04:21 -0600 | [diff] [blame] | 59 | formatter_class=argparse.ArgumentDefaultsHelpFormatter, |
Michael Walsh | c33ef37 | 2017-01-10 11:46:29 -0600 | [diff] [blame] | 60 | prefix_chars='-+') |
Michael Walsh | 7423c01 | 2016-10-04 10:27:21 -0500 | [diff] [blame] | 61 | |
| 62 | # Create arguments. |
| 63 | parser.add_argument( |
| 64 | 'plug_in_dir_paths', |
| 65 | nargs='?', |
| 66 | default="", |
Michael Walsh | c33ef37 | 2017-01-10 11:46:29 -0600 | [diff] [blame] | 67 | help=plug_in_dir_paths_help_text + default_string) |
Michael Walsh | 7423c01 | 2016-10-04 10:27:21 -0500 | [diff] [blame] | 68 | |
| 69 | parser.add_argument( |
| 70 | '--call_point', |
| 71 | default="setup", |
| 72 | required=True, |
Joy Onyerikwu | 004ad3c | 2018-06-11 16:29:56 -0500 | [diff] [blame] | 73 | help='The call point program name. This value must not include the' |
| 74 | + ' "cp_" prefix. For each plug-in package passed to this program,' |
| 75 | + ' the specified call_point program will be called if it exists in' |
| 76 | + ' the plug-in directory.' + default_string) |
Michael Walsh | 7423c01 | 2016-10-04 10:27:21 -0500 | [diff] [blame] | 77 | |
| 78 | parser.add_argument( |
Michael Walsh | ed18ec7 | 2017-06-27 10:15:31 -0500 | [diff] [blame] | 79 | '--allow_shell_rc', |
Michael Walsh | 7423c01 | 2016-10-04 10:27:21 -0500 | [diff] [blame] | 80 | default="0x00000000", |
Joy Onyerikwu | 004ad3c | 2018-06-11 16:29:56 -0500 | [diff] [blame] | 81 | help='The user may supply a value other than zero to indicate an' |
| 82 | + ' acceptable non-zero return code. For example, if this value' |
| 83 | + ' equals 0x00000200, it means that for each plug-in call point that' |
| 84 | + ' runs, a 0x00000200 will not be counted as a failure. See note' |
| 85 | + ' above regarding left-shifting of return codes.' + default_string) |
Michael Walsh | 7423c01 | 2016-10-04 10:27:21 -0500 | [diff] [blame] | 86 | |
| 87 | parser.add_argument( |
| 88 | '--stop_on_plug_in_failure', |
| 89 | default=1, |
| 90 | type=int, |
| 91 | choices=[1, 0], |
Joy Onyerikwu | 004ad3c | 2018-06-11 16:29:56 -0500 | [diff] [blame] | 92 | help='If this parameter is set to 1, this program will stop and return ' |
| 93 | + 'non-zero if the call point program from any plug-in directory ' |
| 94 | + 'fails. Conversely, if it is set to false, this program will run ' |
| 95 | + 'the call point program from each and every plug-in directory ' |
| 96 | + 'regardless of their return values. Typical example cases where ' |
| 97 | + 'you\'d want to run all plug-in call points regardless of success ' |
| 98 | + 'or failure would be "cleanup" or "ffdc" call points.') |
Michael Walsh | 7423c01 | 2016-10-04 10:27:21 -0500 | [diff] [blame] | 99 | |
| 100 | parser.add_argument( |
| 101 | '--stop_on_non_zero_rc', |
| 102 | default=0, |
| 103 | type=int, |
| 104 | choices=[1, 0], |
Joy Onyerikwu | 004ad3c | 2018-06-11 16:29:56 -0500 | [diff] [blame] | 105 | help='If this parm is set to 1 and a plug-in call point program returns ' |
| 106 | + 'a valid non-zero return code (see "allow_shell_rc" parm above),' |
| 107 | + ' this program will stop processing and return 0 (success). Since' |
| 108 | + ' this constitutes a successful exit, this would normally be used' |
| 109 | + ' where the caller wishes to stop processing if one of the plug-in' |
| 110 | + ' directory call point programs returns a special value indicating' |
| 111 | + ' that some special case has been found. An example might be in' |
| 112 | + ' calling some kind of "check_errl" call point program. Such a' |
| 113 | + ' call point program might return a 2 (i.e. 0x00000200) to indicate' |
| 114 | + ' that a given error log entry was found in an "ignore" list and is' |
| 115 | + ' therefore to be ignored. That being the case, no other' |
| 116 | + ' "check_errl" call point program would need to be called.' |
| 117 | + default_string) |
Michael Walsh | 7423c01 | 2016-10-04 10:27:21 -0500 | [diff] [blame] | 118 | |
| 119 | parser.add_argument( |
| 120 | '--mch_class', |
| 121 | default="obmc", |
Michael Walsh | c33ef37 | 2017-01-10 11:46:29 -0600 | [diff] [blame] | 122 | help=mch_class_help_text + default_string) |
Michael Walsh | 7423c01 | 2016-10-04 10:27:21 -0500 | [diff] [blame] | 123 | |
| 124 | # The stock_list will be passed to gen_get_options. We populate it with the |
| 125 | # names of stock parm options we want. These stock parms are pre-defined by |
| 126 | # gen_get_options. |
| 127 | stock_list = [("test_mode", 0), ("quiet", 1), ("debug", 0)] |
Michael Walsh | 7423c01 | 2016-10-04 10:27:21 -0500 | [diff] [blame] | 128 | |
| 129 | |
Michael Walsh | 7423c01 | 2016-10-04 10:27:21 -0500 | [diff] [blame] | 130 | def exit_function(signal_number=0, |
| 131 | frame=None): |
Michael Walsh | 7423c01 | 2016-10-04 10:27:21 -0500 | [diff] [blame] | 132 | r""" |
| 133 | Execute whenever the program ends normally or with the signals that we |
| 134 | catch (i.e. TERM, INT). |
| 135 | """ |
| 136 | |
| 137 | dprint_executing() |
| 138 | dprint_var(signal_number) |
| 139 | |
| 140 | qprint_pgm_footer() |
| 141 | |
Michael Walsh | 7423c01 | 2016-10-04 10:27:21 -0500 | [diff] [blame] | 142 | |
Michael Walsh | 7423c01 | 2016-10-04 10:27:21 -0500 | [diff] [blame] | 143 | def signal_handler(signal_number, frame): |
Michael Walsh | 7423c01 | 2016-10-04 10:27:21 -0500 | [diff] [blame] | 144 | r""" |
| 145 | Handle signals. Without a function to catch a SIGTERM or SIGINT, our |
| 146 | program would terminate immediately with return code 143 and without |
| 147 | calling our exit_function. |
| 148 | """ |
| 149 | |
| 150 | # Our convention is to set up exit_function with atexit.registr() so |
| 151 | # there is no need to explicitly call exit_function from here. |
| 152 | |
| 153 | dprint_executing() |
| 154 | |
| 155 | # Calling exit prevents us from returning to the code that was running |
| 156 | # when we received the signal. |
| 157 | exit(0) |
| 158 | |
Michael Walsh | 7423c01 | 2016-10-04 10:27:21 -0500 | [diff] [blame] | 159 | |
Michael Walsh | 7423c01 | 2016-10-04 10:27:21 -0500 | [diff] [blame] | 160 | def validate_parms(): |
Michael Walsh | 7423c01 | 2016-10-04 10:27:21 -0500 | [diff] [blame] | 161 | r""" |
| 162 | Validate program parameters, etc. Return True or False accordingly. |
| 163 | """ |
| 164 | |
| 165 | if not valid_value(call_point): |
| 166 | return False |
| 167 | |
Michael Walsh | ed18ec7 | 2017-06-27 10:15:31 -0500 | [diff] [blame] | 168 | global allow_shell_rc |
| 169 | if not valid_integer(allow_shell_rc): |
Michael Walsh | c33ef37 | 2017-01-10 11:46:29 -0600 | [diff] [blame] | 170 | return False |
| 171 | |
| 172 | # Convert to hex string for consistency in printout. |
Michael Walsh | ed18ec7 | 2017-06-27 10:15:31 -0500 | [diff] [blame] | 173 | allow_shell_rc = "0x%08x" % int(allow_shell_rc, 0) |
| 174 | set_pgm_arg(allow_shell_rc) |
Michael Walsh | c33ef37 | 2017-01-10 11:46:29 -0600 | [diff] [blame] | 175 | |
Michael Walsh | 7423c01 | 2016-10-04 10:27:21 -0500 | [diff] [blame] | 176 | gen_post_validation(exit_function, signal_handler) |
| 177 | |
| 178 | return True |
| 179 | |
Michael Walsh | 7423c01 | 2016-10-04 10:27:21 -0500 | [diff] [blame] | 180 | |
Michael Walsh | 7423c01 | 2016-10-04 10:27:21 -0500 | [diff] [blame] | 181 | def run_pgm(plug_in_dir_path, |
| 182 | call_point, |
Michael Walsh | ed18ec7 | 2017-06-27 10:15:31 -0500 | [diff] [blame] | 183 | allow_shell_rc): |
Michael Walsh | 7423c01 | 2016-10-04 10:27:21 -0500 | [diff] [blame] | 184 | r""" |
| 185 | Run the call point program in the given plug_in_dir_path. Return the |
| 186 | following: |
| 187 | rc The return code - 0 = PASS, 1 = FAIL. |
| 188 | shell_rc The shell return code returned by |
| 189 | process_plug_in_packages.py. |
| 190 | failed_plug_in_name The failed plug in name (if any). |
| 191 | |
| 192 | Description of arguments: |
| 193 | plug_in_dir_path The directory path where the call_point |
| 194 | program may be located. |
| 195 | call_point The call point (e.g. "setup"). This |
| 196 | program will look for a program named |
| 197 | "cp_" + call_point in the |
| 198 | plug_in_dir_path. If no such call point |
| 199 | program is found, this function returns an |
| 200 | rc of 0 (i.e. success). |
Michael Walsh | ed18ec7 | 2017-06-27 10:15:31 -0500 | [diff] [blame] | 201 | allow_shell_rc The user may supply a value other than |
Michael Walsh | 7423c01 | 2016-10-04 10:27:21 -0500 | [diff] [blame] | 202 | zero to indicate an acceptable non-zero |
| 203 | return code. For example, if this value |
| 204 | equals 0x00000200, it means that for each |
| 205 | plug-in call point that runs, a 0x00000200 |
| 206 | will not be counted as a failure. See |
| 207 | note above regarding left-shifting of |
| 208 | return codes. |
| 209 | """ |
| 210 | |
| 211 | rc = 0 |
| 212 | failed_plug_in_name = "" |
| 213 | shell_rc = 0x00000000 |
| 214 | |
Michael Walsh | 97d5b36 | 2017-05-30 17:57:38 -0500 | [diff] [blame] | 215 | plug_in_name = os.path.basename(os.path.normpath(plug_in_dir_path)) |
Michael Walsh | 7423c01 | 2016-10-04 10:27:21 -0500 | [diff] [blame] | 216 | cp_prefix = "cp_" |
| 217 | plug_in_pgm_path = plug_in_dir_path + cp_prefix + call_point |
| 218 | if not os.path.exists(plug_in_pgm_path): |
| 219 | # No such call point in this plug in dir path. This is legal so we |
| 220 | # return 0, etc. |
| 221 | return rc, shell_rc, failed_plug_in_name |
| 222 | |
Joy Onyerikwu | 004ad3c | 2018-06-11 16:29:56 -0500 | [diff] [blame] | 223 | print("------------------------------------------------- Starting plug-" |
| 224 | + "in -----------------------------------------------") |
Michael Walsh | 8c5a8a8 | 2018-10-30 13:17:23 -0500 | [diff] [blame] | 225 | |
| 226 | print_timen("Running " + plug_in_name + "/" + cp_prefix + call_point + ".") |
Michael Walsh | b3beaa8 | 2019-03-26 16:35:30 -0500 | [diff] [blame] | 227 | |
| 228 | stdout = 1 - quiet |
| 229 | if AUTOBOOT_OPENBMC_NICKNAME != "": |
| 230 | auto_status_file_prefix = AUTOBOOT_OPENBMC_NICKNAME + "." |
Michael Walsh | 97d5b36 | 2017-05-30 17:57:38 -0500 | [diff] [blame] | 231 | else: |
Michael Walsh | b3beaa8 | 2019-03-26 16:35:30 -0500 | [diff] [blame] | 232 | auto_status_file_prefix = "" |
| 233 | auto_status_file_prefix += plug_in_name + ".cp_" + call_point |
| 234 | status_dir_path =\ |
| 235 | add_trailing_slash(os.environ.get("STATUS_DIR_PATH", |
| 236 | os.environ['HOME'] |
| 237 | + "/status/")) |
| 238 | if not os.path.isdir(status_dir_path): |
| 239 | AUTOBOOT_EXECDIR = \ |
| 240 | add_trailing_slash(os.environ.get("AUTOBOOT_EXECDIR", "")) |
| 241 | status_dir_path = AUTOBOOT_EXECDIR + "logs/" |
| 242 | if not os.path.exists(status_dir_path): |
| 243 | os.makedirs(status_dir_path) |
| 244 | status_file_name = auto_status_file_prefix + "." + file_date_time_stamp() \ |
| 245 | + ".status" |
| 246 | auto_status_file_subcmd = "auto_status_file.py --status_dir_path=" \ |
| 247 | + status_dir_path + " --status_file_name=" + status_file_name \ |
| 248 | + " --quiet=1 --show_url=1 --prefix=" \ |
| 249 | + auto_status_file_prefix + " --stdout=" + str(stdout) + " " |
Michael Walsh | 97d5b36 | 2017-05-30 17:57:38 -0500 | [diff] [blame] | 250 | |
Michael Walsh | 3ba8ecd | 2018-04-24 11:33:25 -0500 | [diff] [blame] | 251 | cmd_buf = "PATH=" + plug_in_dir_path.rstrip("/") + ":${PATH} ; " +\ |
Michael Walsh | b3beaa8 | 2019-03-26 16:35:30 -0500 | [diff] [blame] | 252 | auto_status_file_subcmd + cp_prefix + call_point |
Michael Walsh | 8c5a8a8 | 2018-10-30 13:17:23 -0500 | [diff] [blame] | 253 | print_issuing(cmd_buf) |
Michael Walsh | 7423c01 | 2016-10-04 10:27:21 -0500 | [diff] [blame] | 254 | |
Michael Walsh | be6153b | 2016-12-09 13:36:22 -0600 | [diff] [blame] | 255 | sub_proc = subprocess.Popen(cmd_buf, shell=True) |
| 256 | sub_proc.communicate() |
Michael Walsh | 7423c01 | 2016-10-04 10:27:21 -0500 | [diff] [blame] | 257 | shell_rc = sub_proc.returncode |
Michael Walsh | c33ef37 | 2017-01-10 11:46:29 -0600 | [diff] [blame] | 258 | # Shift to left. |
| 259 | shell_rc *= 0x100 |
Michael Walsh | ed18ec7 | 2017-06-27 10:15:31 -0500 | [diff] [blame] | 260 | if shell_rc != 0 and shell_rc != allow_shell_rc: |
Michael Walsh | 7423c01 | 2016-10-04 10:27:21 -0500 | [diff] [blame] | 261 | rc = 1 |
Michael Walsh | 8c5a8a8 | 2018-10-30 13:17:23 -0500 | [diff] [blame] | 262 | failed_plug_in_name = plug_in_name + "/" + cp_prefix + call_point |
Michael Walsh | 3ba8ecd | 2018-04-24 11:33:25 -0500 | [diff] [blame] | 263 | if shell_rc != 0: |
Michael Walsh | 8c5a8a8 | 2018-10-30 13:17:23 -0500 | [diff] [blame] | 264 | failed_plug_in_name = plug_in_name + "/" + cp_prefix + call_point |
Michael Walsh | b3beaa8 | 2019-03-26 16:35:30 -0500 | [diff] [blame] | 265 | if failed_plug_in_name != "" and not stdout: |
| 266 | # Use tail to avoid double-printing of status_file_url. |
| 267 | shell_cmd("tail -n +2 " + status_dir_path + status_file_name, quiet=1, |
Michael Walsh | 8c5a8a8 | 2018-10-30 13:17:23 -0500 | [diff] [blame] | 268 | print_output=1) |
Michael Walsh | 7423c01 | 2016-10-04 10:27:21 -0500 | [diff] [blame] | 269 | |
Joy Onyerikwu | 004ad3c | 2018-06-11 16:29:56 -0500 | [diff] [blame] | 270 | print("------------------------------------------------- Ending plug-in" |
| 271 | + " -------------------------------------------------") |
Michael Walsh | 97d5b36 | 2017-05-30 17:57:38 -0500 | [diff] [blame] | 272 | if failed_plug_in_name != "": |
| 273 | print_var(failed_plug_in_name) |
Michael Walsh | 0d5f96a | 2019-05-20 10:09:57 -0500 | [diff] [blame] | 274 | print_var(shell_rc, hexa()) |
Michael Walsh | 7423c01 | 2016-10-04 10:27:21 -0500 | [diff] [blame] | 275 | |
| 276 | return rc, shell_rc, failed_plug_in_name |
| 277 | |
Michael Walsh | 7423c01 | 2016-10-04 10:27:21 -0500 | [diff] [blame] | 278 | |
Michael Walsh | 7423c01 | 2016-10-04 10:27:21 -0500 | [diff] [blame] | 279 | def main(): |
Michael Walsh | 7423c01 | 2016-10-04 10:27:21 -0500 | [diff] [blame] | 280 | r""" |
| 281 | This is the "main" function. The advantage of having this function vs |
| 282 | just doing this in the true mainline is that you can: |
| 283 | - Declare local variables |
| 284 | - Use "return" instead of "exit". |
| 285 | - Indent 4 chars like you would in any function. |
| 286 | This makes coding more consistent, i.e. it's easy to move code from here |
| 287 | into a function and vice versa. |
| 288 | """ |
| 289 | |
| 290 | if not gen_get_options(parser, stock_list): |
| 291 | return False |
| 292 | |
| 293 | if not validate_parms(): |
| 294 | return False |
| 295 | |
| 296 | qprint_pgm_header() |
| 297 | |
| 298 | # Access program parameter globals. |
| 299 | global plug_in_dir_paths |
| 300 | global mch_class |
Michael Walsh | ed18ec7 | 2017-06-27 10:15:31 -0500 | [diff] [blame] | 301 | global allow_shell_rc |
Michael Walsh | 7423c01 | 2016-10-04 10:27:21 -0500 | [diff] [blame] | 302 | global stop_on_plug_in_failure |
| 303 | global stop_on_non_zero_rc |
| 304 | |
| 305 | plug_in_packages_list = return_plug_in_packages_list(plug_in_dir_paths, |
| 306 | mch_class) |
| 307 | |
Michael Walsh | 0d5f96a | 2019-05-20 10:09:57 -0500 | [diff] [blame] | 308 | qprint_var(plug_in_packages_list) |
Michael Walsh | 7423c01 | 2016-10-04 10:27:21 -0500 | [diff] [blame] | 309 | qprint("\n") |
| 310 | |
Michael Walsh | ed18ec7 | 2017-06-27 10:15:31 -0500 | [diff] [blame] | 311 | allow_shell_rc = int(allow_shell_rc, 0) |
Michael Walsh | a6723f2 | 2016-11-22 11:12:01 -0600 | [diff] [blame] | 312 | shell_rc = 0 |
Michael Walsh | 7423c01 | 2016-10-04 10:27:21 -0500 | [diff] [blame] | 313 | failed_plug_in_name = "" |
| 314 | |
Michael Walsh | 97d5b36 | 2017-05-30 17:57:38 -0500 | [diff] [blame] | 315 | global AUTOBOOT_OPENBMC_NICKNAME |
Michael Walsh | b3beaa8 | 2019-03-26 16:35:30 -0500 | [diff] [blame] | 316 | AUTOBOOT_OPENBMC_NICKNAME = os.environ.get("AUTOBOOT_OPENBMC_NICKNAME", "") |
| 317 | |
Michael Walsh | 7423c01 | 2016-10-04 10:27:21 -0500 | [diff] [blame] | 318 | ret_code = 0 |
| 319 | for plug_in_dir_path in plug_in_packages_list: |
| 320 | rc, shell_rc, failed_plug_in_name = \ |
Michael Walsh | ed18ec7 | 2017-06-27 10:15:31 -0500 | [diff] [blame] | 321 | run_pgm(plug_in_dir_path, call_point, allow_shell_rc) |
Michael Walsh | 7423c01 | 2016-10-04 10:27:21 -0500 | [diff] [blame] | 322 | if rc != 0: |
| 323 | ret_code = 1 |
| 324 | if stop_on_plug_in_failure: |
| 325 | break |
| 326 | if shell_rc != 0 and stop_on_non_zero_rc: |
Joy Onyerikwu | 004ad3c | 2018-06-11 16:29:56 -0500 | [diff] [blame] | 327 | qprint_time("Stopping on non-zero shell return code as requested" |
| 328 | + " by caller.\n") |
Michael Walsh | 7423c01 | 2016-10-04 10:27:21 -0500 | [diff] [blame] | 329 | break |
| 330 | |
| 331 | if ret_code == 0: |
| 332 | return True |
| 333 | else: |
Michael Walsh | 8c5a8a8 | 2018-10-30 13:17:23 -0500 | [diff] [blame] | 334 | print_error("At least one plug-in failed.\n") |
Michael Walsh | 7423c01 | 2016-10-04 10:27:21 -0500 | [diff] [blame] | 335 | return False |
| 336 | |
Michael Walsh | 7423c01 | 2016-10-04 10:27:21 -0500 | [diff] [blame] | 337 | |
Michael Walsh | 7423c01 | 2016-10-04 10:27:21 -0500 | [diff] [blame] | 338 | # Main |
| 339 | |
| 340 | if not main(): |
| 341 | exit(1) |