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