def execute(): logger.info("The following set of commands is available for execution: %s" % ",".join([s for s,c in CONF.COMMANDS])) logger.info("The following set of commands will be executed: %s" % ",".join(commandsToRun)) if ( "CLEANUP_WWW_AREA" in commandsToRun ) : logger.info("Cleaning up logs area...") CONF.cleanupLogs() for section,cmds in CONF.COMMANDS: if section in commandsToRun : logger.info("----++++ %s ++++----" % section) for cmd in cmds: system(cmd,log=True, exception=False)
def execute(): logger.info( "The following set of commands is available for execution: %s" % ",".join([s for s, c in CONF.COMMANDS])) logger.info("The following set of commands will be executed: %s" % ",".join(commandsToRun)) if ("CLEANUP_WWW_AREA" in commandsToRun): logger.info("Cleaning up logs area...") CONF.cleanupLogs() for section, cmds in CONF.COMMANDS: if section in commandsToRun: logger.info("----++++ %s ++++----" % section) for cmd in cmds: system(cmd, log=True, exception=False)
if listonly : print "The following set of commands is available for execution: %s" % ",".join([s for s,c in CONF.COMMANDS]) sys.exit(0) # Check if command list given is valid for command in commandsToRun: if command in [s for s,c in CONF.COMMANDS] : continue else: sys.stderr.write( "ERROR: Command '" + command + "' is not available.\n" ) sys.stderr.write( "List of available commands : %s\n" % str([s for s,c in CONF.COMMANDS]) ) sys.exit(2) if not silent : logger.info("Reports will be sent to: %s" % CONF.TO_EMAIL ) # Execute build/test/etc. try: execute() except KeyboardInterrupt,e: logger.warning('Aborting after CTRL-C...\n') sys.exit(1) except Exception,e: logger.error(e) if silent: logger.info("Final reporting and email notifications were disabled") else: logger.info("----++++REPORTING++++----")
[s for s, c in CONF.COMMANDS]) sys.exit(0) # Check if command list given is valid for command in commandsToRun: if command in [s for s, c in CONF.COMMANDS]: continue else: sys.stderr.write("ERROR: Command '" + command + "' is not available.\n") sys.stderr.write("List of available commands : %s\n" % str([s for s, c in CONF.COMMANDS])) sys.exit(2) if not silent: logger.info("Reports will be sent to: %s" % CONF.TO_EMAIL) # Execute build/test/etc. try: execute() except KeyboardInterrupt, e: logger.warning('Aborting after CTRL-C...\n') sys.exit(1) except Exception, e: logger.error(e) if silent: logger.info("Final reporting and email notifications were disabled") else: logger.info("----++++REPORTING++++----") nanalyzer.report(CONF)