def main(): opts = parse_arguments() level = logging.INFO if opts.debug: level = logging.DEBUG if opts.quiet: level = logging.ERROR logging.basicConfig(level=level) logging.debug('starting...') opts.verify = not opts.no_verify logging.debug('options: %r', opts) try: commands = { 'deployment': deps.do_main, 'admission': devadm.do_main, 'authentication': devauth.do_main, 'device': device.do_main, 'artifact': artifacts.do_main, 'inventory': inventory.do_main, 'client': client.do_main, 'user': user.do_main, } run_command(opts.command, commands, opts) except ClientError as rerr: logging.error('request failed: %s', rerr) except CommandNotSupportedError: logging.error('incomplete or unsupported command, see --help')
def main(): opts = parse_arguments() level = logging.INFO if opts.debug: level = logging.DEBUG logging.basicConfig(level=level) logging.debug('starting...') opts.verify = not opts.no_verify logging.debug('options: %r', opts) try: commands = { 'deployment': deps.do_main, 'admission': devadm.do_main, 'authentication': devauth.do_main, 'device': device.do_main, 'artifact': artifacts.do_main, 'inventory': inventory.do_main, 'client': client.do_main, 'user': user.do_main, } run_command(opts.command, commands, opts) except ClientError as rerr: logging.error('request failed: %s', rerr) except CommandNotSupportedError: logging.error('incomplete or unsupported command, see --help')
def do_device(opts): commands = { 'show': device_show, 'group': device_group, 'list': devices_list, } run_command(opts.invdevcommand, commands, opts)
def do_main(opts): commands = { 'list': list_device_auths, 'accept': lambda o: set_device_auth_status(o, 'accepted'), 'reject': lambda o: set_device_auth_status(o, 'rejected'), 'show': show_device_auth, } run_command(opts.admcommand, commands, opts)
def do_main(opts): commands = { 'list': list_device_auths, 'accept': lambda o: set_device_auth_status(o, 'accepted'), 'reject': lambda o: set_device_auth_status(o, 'rejected'), 'show': show_device_auth, } run_command(opts.admcommand, commands, opts)
def do_main(opts): commands = { 'list': list_devices, 'count': count_devices, 'show': show_device, 'delete': delete_device, } run_command(opts.authcommand, commands, opts)
def do_main(opts): commands = { 'list': list_devices, 'count': count_devices, 'show': show_device, 'delete': delete_device, } run_command(opts.authcommand, commands, opts)
def do_main(opts): logging.debug('user opts: %r', opts) cmds = { 'login': do_user_login, 'token': do_user_token, 'initial-login': do_user_login_initial, 'initial': do_user_create_initial, 'list': list_users, } run_command(opts.usercommand, cmds, opts)
def do_main(opts): logging.debug('user opts: %r', opts) cmds = { 'login': do_user_login, 'token': do_user_token, 'initial-login': do_user_login_initial, 'initial': do_user_create_initial, 'list': list_users, } run_command(opts.usercommand, cmds, opts)
def do_main(opts): commands = { 'authorize': do_authorize, 'key': do_key, 'update': do_update, 'token': do_token, 'inventory': do_inventory, 'fake-update': do_fake_update } run_command(opts.devcommand, commands, opts)
def do_main(opts): commands = { 'authorize': do_authorize, 'key': do_key, 'update': do_update, 'token': do_token, 'inventory': do_inventory, 'fake-update': do_fake_update } run_command(opts.devcommand, commands, opts)
def do_main(opts): logging.debug('artifacts opts: %r', opts) cmds = { 'find': None, 'list': do_artifacts_list, 'add': do_artifacts_artifact_add, 'show': do_artifacts_show, 'remove': None, 'download': do_artifacts_download, } run_command(opts.artcommand, cmds, opts)
def do_main(opts): logging.debug('deployment opts: %r', opts) cmds = { 'add': do_deployments_add, 'devices': do_deployments_devices, 'find': do_deployments_find, 'logs': do_deployments_logs, 'stats': do_deployments_stats, 'status': do_deployments_status, } run_command(opts.depcommand, cmds, opts)
def do_main(opts): logging.debug('deployment opts: %r', opts) cmds = { 'add': do_deployments_add, 'devices': do_deployments_devices, 'find': do_deployments_find, 'logs': do_deployments_logs, 'stats': do_deployments_stats, 'status': do_deployments_status, } run_command(opts.depcommand, cmds, opts)
def do_group(opts): commands = { 'list': group_list, 'show': group_show, } run_command(opts.invgrcommand, commands, opts)
def do_main(opts): commands = { 'group': do_group, 'device': do_device, } run_command(opts.invcommand, commands, opts)