예제 #1
0
파일: cli.py 프로젝트: drummerwolli/piu
 def resolve_command(self, ctx, args):
     cmd_name = args[0]
     cmd = AliasedGroup.get_command(self, ctx, cmd_name)
     if not cmd:
         cmd_name = DEFAULT_COMMAND
         cmd = AliasedGroup.get_command(self, ctx, cmd_name)
         new_args = args
     else:
         new_args = args[1:]
     return cmd_name, cmd, new_args
예제 #2
0
파일: cli.py 프로젝트: outime/piu
 def resolve_command(self, ctx, args):
     cmd_name = args[0]
     cmd = AliasedGroup.get_command(self, ctx, cmd_name)
     if not cmd:
         cmd_name = DEFAULT_COMMAND
         cmd = AliasedGroup.get_command(self, ctx, cmd_name)
         new_args = args
     else:
         new_args = args[1:]
     return cmd_name, cmd, new_args
예제 #3
0
    'public_ip': 'Public IP',
    'resource_id': 'Resource ID',
    'instance_id': 'Instance ID',
    'version': 'Ver.'
}

COMPLETE_STATES = [
    'CREATE_COMPLETE',
    'ROLLBACK_COMPLETE',
    'UPDATE_COMPLETE',
    'UPDATE_ROLLBACK_COMPLETE'
]

requests.packages.urllib3.disable_warnings()  # Disable the security warnings

main = AliasedGroup(context_settings=dict(help_option_names=['-h', '--help']))


def main_with_metrics():
    """
    Runs main() and reports success and failure metrics
    """
    try:
        main()
    except Exception:
        report_metric("bus.lizzy-client.failed", 1)
        raise
    except SystemExit as sys_exit:
        if sys_exit.code == 0:
            report_metric("bus.lizzy-client.success", 1)
        else: