Ejemplo n.º 1
0
def get_run_or_local(run_uuid=None, is_cli: bool = False):
    if run_uuid:
        return run_uuid
    if is_cli:
        return RunConfigManager.get_config_or_raise().uuid

    run = RunConfigManager.get_config()
    if run:
        return run.uuid
    return None
Ejemplo n.º 2
0
def get_run_or_local(run_uuid=None, is_cli: bool = False):
    if run_uuid:
        return run_uuid
    if is_cli:
        return RunConfigManager.get_config_or_raise().uuid

    try:
        run = RunConfigManager.get_config()
    except TypeError:
        Printer.print_error(
            "Found an invalid run config or run config cache, "
            "if you are using Polyaxon CLI please run: "
            "`polyaxon config purge --cache-only`",
            sys_exit=True,
        )
    if run:
        return run.uuid
    return None