示例#1
0
文件: cli.py 项目: CCI-MOC/hil
def main():
    """CLI entry point"""
    ensure_not_root()
    try:
        cli()
    except FailedAPICallException as e:
        sys.exit('Error: %s\n' % e.message)
    except Exception as e:
        sys.exit(e)
示例#2
0
def main():
    """CLI entry point"""
    ensure_not_root()
    try:
        cli()
    except FailedAPICallException as e:
        sys.exit('Error: %s\n' % e.message)
    except Exception as e:
        sys.exit(e)
示例#3
0
def main():
    """Entry point to the CLI.

    There is a script located at ${source_tree}/scripts/hil, which invokes
    this function.
    """
    ensure_not_root()

    if len(sys.argv) < 2 or sys.argv[1] not in command_dict:
        # Display usage for all commands
        help()
        sys.exit(1)
    else:
        setup_http_client()
        try:
            command_dict[sys.argv[1]](*sys.argv[2:])
        except FailedAPICallException as e:
            sys.exit('Error: %s\n' % e.message)
        except InvalidAPIArgumentsException as e:
            sys.exit('Error: %s\n' % e.message)
        except Exception as e:
            sys.exit('Unexpected error: %s\n' % e.message)
示例#4
0
文件: admin.py 项目: djfinn14/hil
def main():
    """Entrypoint for the hil-admin command."""
    ensure_not_root()
    config.setup()
    model.init_db()
    manager.run()
示例#5
0
文件: admin.py 项目: CCI-MOC/hil
def main():
    """Entrypoint for the hil-admin command."""
    ensure_not_root()
    config.setup()
    model.init_db()
    manager.run()