示例#1
0
def main(argv=None):

    if argv is None:
        argv = sys.argv

    service.prepare_service(argv)

    if cfg.CONF.master_seed and not cfg.CONF.resource_registry:
        sys.stderr.write("When using `master-seed` you must also specify "
                         "`resource-registry`.")
        sys.exit(1)

    all_roles, created, updated = load_roles(
        cfg.CONF.role,
        seed_file=cfg.CONF.master_seed,
        resource_registry_path=cfg.CONF.resource_registry,
        role_extra=cfg.CONF.role_extra)

    if len(created):
        _print_names("Created", created)

    if len(updated):
        _print_names("Updated", updated)

    print("Imported {0} roles".format(len(all_roles)))
示例#2
0
def main(argv=None):

    if argv is None:
        argv = sys.argv

    service.prepare_service(argv)

    if cfg.CONF.master_seed and not cfg.CONF.resource_registry:
        sys.stderr.write("When using `master-seed` you must also specify "
                         "`resource-registry`.")
        sys.exit(1)

    all_roles, created, updated = load_roles(
        cfg.CONF.role,
        seed_file=cfg.CONF.master_seed,
        resource_registry_path=cfg.CONF.resource_registry,
        role_extra=cfg.CONF.role_extra)

    if len(created):
        _print_names("Created", created)

    if len(updated):
        _print_names("Updated", updated)

    print("Imported {0} roles".format(len(all_roles)))
示例#3
0
文件: api.py 项目: jsomara/tuskar
def main():
    # Parse config file and command line options, then start logging
    tuskar_service.prepare_service(sys.argv)

    # Build and start the WSGI app
    host = CONF.tuskar_api_bind_ip
    port = CONF.tuskar_api_port
    wsgi = simple_server.make_server(
        host, port,
        app.VersionSelectorApplication())

    LOG = log.getLogger(__name__)
    LOG.info("Serving on http://%s:%s" % (host, port))
    LOG.info("Configuration:")
    CONF.log_opt_values(LOG, logging.INFO)
    # make sure we have tripleo-heat-templates:
    heat_template_path = CONF.tht_local_dir
    try:
        os.listdir(heat_template_path)
    except OSError:
        LOG.info(
            "Can't find local tripleo-heat-template files at %s"
            % (heat_template_path))
        LOG.info(
            "Cannot proceed - missing tripleo heat templates "
            "See INSTALL documentation for more info")
        raise
    LOG.info("Using tripleo-heat-templates at %s" % (heat_template_path))

    try:
        wsgi.serve_forever()
    except KeyboardInterrupt:
        pass
示例#4
0
文件: manager.py 项目: jsomara/tuskar
def main():
    # Pase config file and command line options, then start logging
    tuskar_service.prepare_service(sys.argv)

    topic = 'tuskar.manager'
    mgr = manager.ManagerService(CONF.host, topic)
    launcher = service.launch(mgr)
    launcher.wait()
示例#5
0
def main():
    # Pase config file and command line options, then start logging
    tuskar_service.prepare_service(sys.argv)

    topic = 'tuskar.manager'
    mgr = manager.ManagerService(CONF.host, topic)
    launcher = service.launch(mgr)
    launcher.wait()
示例#6
0
def main(argv=None):

    if argv is None:
        argv = sys.argv

    # Prepare the Tuskar service and load the database backend.
    service.prepare_service(argv)
    get_backend()

    migration.db_sync()
示例#7
0
文件: dbsync.py 项目: marios/tuskar-1
def main(argv=None):

    if argv is None:
        argv = sys.argv

    # Prepare the Tuskar service and load the database backend.
    service.prepare_service(argv)
    get_backend()

    migration.db_sync()
示例#8
0
def main(argv=None):
    if argv is None:
        argv = sys.argv

    index = argv.index('--uuids')
    service.prepare_service(argv[:index])
    roles = argv[index + 1:]

    deleted = delete_roles(roles, noop=cfg.CONF.dryrun)

    if len(deleted):
        _print_names("Deleted", deleted)
示例#9
0
def main(argv=None):
    if argv is None:
        argv = sys.argv

    index = argv.index('--uuids')
    service.prepare_service(argv[:index])
    roles = argv[index + 1:]

    deleted = delete_roles(roles, noop=cfg.CONF.dryrun)

    if len(deleted):
        _print_names("Deleted", deleted)
示例#10
0
文件: api.py 项目: pombredanne/tuskar
def main():
    # Pase config file and command line options, then start logging
    tuskar_service.prepare_service(sys.argv)

    # Build and start the WSGI app
    host = CONF.tuskar_api_bind_ip
    port = CONF.tuskar_api_port
    wsgi = simple_server.make_server(
            host, port,
            app.VersionSelectorApplication())

    LOG = log.getLogger(__name__)
    LOG.info("Serving on http://%s:%s" % (host, port))
    LOG.info("Configuration:")
    CONF.log_opt_values(LOG, logging.INFO)

    try:
        wsgi.serve_forever()
    except KeyboardInterrupt:
        pass
示例#11
0
def main(argv=None):
    if argv is None:
        argv = sys.argv

    service.prepare_service(argv)
    if not cfg.CONF.file_path:
        sys.stderr.write("You must specify the path to the main template "
                         "which defines this role.")
        sys.exit(1)

    name = cfg.CONF.name if cfg.CONF.name else ''
    relative_path = cfg.CONF.relative_path if cfg.CONF.relative_path else None
    created, updated = load_role(name, cfg.CONF.file_path,
                                 extra_data=cfg.CONF.extra_data,
                                 relative_path=relative_path)

    if len(created):
        _print_names("Created", created)

    if len(updated):
        _print_names("Updated", updated)
示例#12
0
def main(argv=None):

    if argv is None:
        argv = sys.argv

    service.prepare_service(argv)

    if not cfg.CONF.master_seed or not cfg.CONF.resource_registry:
        sys.stderr.write("You must specify both `master-seed` and "
                         "`resource-registry`.")
        sys.exit(1)

    created, updated = load_seed(
        seed_file=cfg.CONF.master_seed,
        resource_registry_path=cfg.CONF.resource_registry)

    if len(created):
        _print_names("Created", created)

    if len(updated):
        _print_names("Updated", updated)
示例#13
0
文件: load_roles.py 项目: jdob/tuskar
def main(argv=None):

    if argv is None:
        argv = sys.argv

    service.prepare_service(argv)

    all_roles, created, updated = load_roles(cfg.CONF.directory,
                                             cfg.CONF.dry_run)

    if len(created):
        _print_names("Created", created)

    if len(updated):
        _print_names("Updated", updated)

    if not cfg.CONF.dry_run:
        print("Imported {0} roles".format(len(all_roles)))
    else:
        _print_names("Found", all_roles)
        print("Imported 0 roles")
示例#14
0
def main(argv=None):

    if argv is None:
        argv = sys.argv

    service.prepare_service(argv)

    if not cfg.CONF.master_seed or not cfg.CONF.resource_registry:
        sys.stderr.write("You must specify both `master-seed` and "
                         "`resource-registry`.")
        sys.exit(1)

    created, updated = load_seed(
        seed_file=cfg.CONF.master_seed,
        resource_registry_path=cfg.CONF.resource_registry)

    if len(created):
        _print_names("Created", created)

    if len(updated):
        _print_names("Updated", updated)
示例#15
0
def main(argv=None):
    if argv is None:
        argv = sys.argv

    service.prepare_service(argv)
    if not cfg.CONF.file_path:
        sys.stderr.write("You must specify the path to the main template "
                         "which defines this role.")
        sys.exit(1)

    name = cfg.CONF.name if cfg.CONF.name else ''
    relative_path = cfg.CONF.relative_path if cfg.CONF.relative_path else None
    created, updated = load_role(name,
                                 cfg.CONF.file_path,
                                 extra_data=cfg.CONF.extra_data,
                                 relative_path=relative_path)

    if len(created):
        _print_names("Created", created)

    if len(updated):
        _print_names("Updated", updated)
示例#16
0
def main(argv=None):

    if argv is None:
        argv = sys.argv

    tuskar_service.prepare_service(argv)

    # Build and start the WSGI app
    host = cfg.CONF.tuskar_api_bind_ip
    port = cfg.CONF.tuskar_api_port
    wsgi = simple_server.make_server(
        host, port,
        app.VersionSelectorApplication())

    LOG = log.getLogger(__name__)
    LOG.info("Serving on http://%s:%s" % (host, port))
    LOG.info("Configuration:")
    cfg.CONF.log_opt_values(LOG, logging.INFO)

    try:
        wsgi.serve_forever()
    except KeyboardInterrupt:
        pass
示例#17
0
文件: dbsync.py 项目: jsomara/tuskar
def main():
    service.prepare_service(sys.argv)
    migration.db_sync()
示例#18
0
def main():
    service.prepare_service(sys.argv)
    migration.db_sync()