Changeset View
Changeset View
Standalone View
Standalone View
swh/scheduler/cli_utils.py
Show First 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | def schedule_origin_batches( | ||||
if nb_tasks: | if nb_tasks: | ||||
click.echo('Done.') | click.echo('Done.') | ||||
else: | else: | ||||
click.echo('Nothing to do (no origin metadata matched the criteria).') | click.echo('Nothing to do (no origin metadata matched the criteria).') | ||||
def parse_argument(option): | def parse_argument(option): | ||||
try: | try: | ||||
return yaml.load(option) | return yaml.safe_load(option) | ||||
except Exception: | except Exception: | ||||
raise click.ClickException('Invalid argument: {}'.format(option)) | raise click.ClickException('Invalid argument: {}'.format(option)) | ||||
def parse_options(options): | def parse_options(options): | ||||
"""Parses options from a CLI as YAML and turns it into Python | """Parses options from a CLI as YAML and turns it into Python | ||||
args and kwargs. | args and kwargs. | ||||
Show All 25 Lines |