Exemplo n.º 1
0
def get_source_type(context, id):
    """Retrieves single source type by ID."""
    check_policy(context, 'get_source_type')
    if id is None:
        msg = _("ID cannot be None")
        raise exception.InvalidSourceType(reason=msg)

    return db.source_type_get(context, id)
Exemplo n.º 2
0
def get_source_type(context, id):
    """Retrieves single source type by ID."""
    check_policy(context, 'get_source_type')
    if id is None:
        msg = _("ID cannot be None")
        raise exception.InvalidSourceType(reason=msg)

    return db.source_type_get(context, id)
Exemplo n.º 3
0
    def _get_driver_from_source(self, context, source):
        source_type_id = source.get('source_type_id')
        con_string = source.get('connection_params')
        source_type = db.source_type_get(context, source_type_id)
        source_driver_path = source_type.get('driver_class_path')

        return self._get_migration_driver(context, source_driver_path,
                                          con_string)
Exemplo n.º 4
0
Arquivo: manager.py Projeto: curx/guts
    def _get_driver_from_source(self, context, source):
        source_type_id = source.get('source_type_id')
        con_string = source.get('connection_params')
        source_type = db.source_type_get(context, source_type_id)
        source_driver_path = source_type.get('driver_class_path')

        return self._get_migration_driver(context,
                                          source_driver_path,
                                          con_string)
Exemplo n.º 5
0
Arquivo: types.py Projeto: curx/guts
def get_source_type(ctxt, id):
    """Retrieves single source type by ID."""
    if id is None:
        msg = _("ID cannot be None")
        raise exception.InvalidSourceType(reason=msg)

    if ctxt is None:
        ctxt = context.get_admin_context()

    return db.source_type_get(ctxt, id)