def main(self, args=None): self.parse(args) verbosity = self.options.verbosity if verbosity == 0: log_level = logging.WARNING elif verbosity == 1: log_level = logging.INFO elif verbosity >= 2: log_level = logging.DEBUG utils.configureLogging(level=log_level) try: self.run() except Exception as e: # Only log stack grace if -v has been used if verbosity >= 1: log.exception(e) else: sys.stderr.write("%s\n" % e) exit(1)
def main(self, args=None): self.parse(args) verbosity = self.options.verbosity if verbosity == 0: log_level = logging.WARNING elif verbosity == 1: log_level = logging.INFO elif verbosity >= 2: log_level = logging.DEBUG utils.configureLogging(level=log_level) try: self.run() except Exception, e: # Only log stack grace if -v has been used if verbosity >= 1: log.exception(e) else: sys.stderr.write("%s\n" % e) exit(1)
share_dir = os.path.normpath(os.path.join(bin_dir, "../share/pegasus")) javascript_dir = os.path.normpath(os.path.join(lib_dir, "../../pegasus/javascript")) # Insert this directory in our search path os.sys.path.insert(0, lib_dir) os.sys.path.insert(0, lib_ext_dir) from Pegasus.plots_stats import utils as plot_utils from Pegasus.plots_stats.plots import populate from Pegasus.plots_stats.plots import pegasus_gantt from Pegasus.plots_stats.plots import pegasus_host_over_time from Pegasus.plots_stats.plots import pegasus_breakdown from Pegasus.plots_stats.plots import pegasus_time from Pegasus.tools import utils utils.configureLogging(level=logging.WARNING) # Regular expressions re_parse_property = re.compile(r'([^:= \t]+)\s*[:=]?\s*(.*)') # Global variables---- prog_base = os.path.split(sys.argv[0])[1] # Name of this program NEW_LINE_STR ="\n" MAX_GRAPH_NODES = 100 calc_dax_graph = False calc_dag_graph = False calc_gantt_chart = False calc_host_chart = False calc_time_chart = False calc_breakdown_chart = False max_graph_nodes = MAX_GRAPH_NODES
if is_prog(prog): return prog else: for path in dir + os.environ["PATH"].split(os.pathsep): exe_file = os.path.join(path, prog) if is_prog(exe_file): return exe_file return None logger = logging.getLogger("pegasus-dagman") # Use pegasus-config to find our lib path print("Pegasus DAGMAN is %s" % sys.argv[0]) utils.configureLogging() SLEEP_TIME = 15 DIED_TOO_QUICKLY_TIME = 300 MONITORD_KILL_TIME = 200 # the number of seconds after pegasus-remove is called, that monitord is sent the kill signal dagman = None monitord = None monitord_last_start = 0 monitord_next_start = 0 monitord_current_restarts = 0 monitord_shutdown_mode = False monitord_shutdown_time = 0
def configure_logging(verbosity=0): verbosity = min(3, verbosity) log_levels = [logging.ERROR, logging.WARN, logging.INFO, logging.DEBUG] utils.configureLogging(level=log_levels[verbosity])