示例#1
0
    def take_action(self, parsed_args):
        # TODO: Support specifying version
        utils.read_config('moniker-central')

        url = cfg.CONF.database_connection

        if not os.path.exists(REPOSITORY):
            raise Exception('Migration Respository Not Found')

        LOG.info('Attempting to synchronize database')
        versioning_api.upgrade(url=url, repository=REPOSITORY,
                               version=None)
        LOG.info('Database synchronized sucessfully')
示例#2
0
    def take_action(self, parsed_args):
        utils.read_config('moniker-central')

        url = cfg.CONF.database_connection

        if not os.path.exists(REPOSITORY):
            raise Exception('Migration Respository Not Found')

        try:
            LOG.info('Attempting to initialize database')
            versioning_api.version_control(url=url, repository=REPOSITORY)
            LOG.info('Database initialized sucessfully')
        except DatabaseAlreadyControlledError:
            raise Exception('Database already initialized')