def main(): args = parse_cli() cmd_utils.setup_logging(args) cmd_utils.load_config(args) client = Client(args.server) error_code = 0 global _run_interval _run_interval = args.run_interval if args.job is None: jobs = client.jobs(include_job_runs=True) for job in jobs: try: check_job_result(job=job, client=client, dry_run=args.dry_run) except Exception as e: log.warning( "check job result fails for job {}: {}".format( job.get('name', ''), e, ) ) error_code = 1 else: job_url = client.get_url(args.job) job = client.job_runs(job_url) check_job_result(job=job, client=client, dry_run=args.dry_run) return error_code
def main(): args = parse_cli() cmd_utils.setup_logging(args) cmd_utils.load_config(args) client = Client(args.server) if check_bin_exists('meteorite'): metrics = client.metrics() send_metrics(metrics, cluster=args.cluster, dry_run=args.dry_run) else: log.error("'meteorite' was not found")
def main(): args = parse_cli() cmd_utils.setup_logging(args) cmd_utils.load_config(args) client = Client(args.server) if args.job is None: jobs = client.jobs(include_job_runs=True) for job in jobs: check_job_result(job=job, client=client, dry_run=args.dry_run) else: job_url = client.get_url(args.job) job = client.job_runs(job_url) check_job_result(job=job, client=client, dry_run=args.dry_run)
def tron_jobs_completer(prefix, **kwargs): if os.path.isfile(TAB_COMPLETE_FILE): with opener(TAB_COMPLETE_FILE, 'r') as f: jobs = f.readlines() return filter_jobs_actions_runs( prefix=prefix, inputs=[job.strip('\n\r') for job in jobs], ) else: if 'client' not in kwargs: client = Client(get_default_server()) else: client = kwargs['client'] return filter_jobs_actions_runs( prefix=prefix, inputs=[job['name'] for job in client.jobs()], )
def tron_jobs_completer(prefix, parsed_args, **kwargs): default_client = Client(get_default_server()) return (job['name'] for job in default_client.jobs() if job['name'].startswith(prefix))