Merge "Follow-up for volume connector db_id"
This commit is contained in:
commit
8a9bdd7218
@ -631,10 +631,10 @@ class Connection(object):
|
||||
"""
|
||||
|
||||
@abc.abstractmethod
|
||||
def get_volume_connector_by_id(self, id):
|
||||
def get_volume_connector_by_id(self, db_id):
|
||||
"""Return a volume connector representation.
|
||||
|
||||
:param id: The ID of a volume connector.
|
||||
:param db_id: The integer database ID of a volume connector.
|
||||
:returns: A volume connector with the specified ID.
|
||||
:raises: VolumeConnectorNotFound If a volume connector
|
||||
with the specified ID is not found.
|
||||
|
@ -881,12 +881,12 @@ class Connection(api.Connection):
|
||||
return _paginate_query(models.VolumeConnector, limit, marker,
|
||||
sort_key, sort_dir)
|
||||
|
||||
def get_volume_connector_by_id(self, id):
|
||||
query = model_query(models.VolumeConnector).filter_by(id=id)
|
||||
def get_volume_connector_by_id(self, db_id):
|
||||
query = model_query(models.VolumeConnector).filter_by(id=db_id)
|
||||
try:
|
||||
return query.one()
|
||||
except NoResultFound:
|
||||
raise exception.VolumeConnectorNotFound(connector=id)
|
||||
raise exception.VolumeConnectorNotFound(connector=db_id)
|
||||
|
||||
def get_volume_connector_by_uuid(self, connector_uuid):
|
||||
query = model_query(models.VolumeConnector).filter_by(
|
||||
|
@ -73,16 +73,17 @@ class VolumeConnector(base.IronicObject,
|
||||
# Implications of calling new remote procedures should be thought through.
|
||||
# @object_base.remotable_classmethod
|
||||
@classmethod
|
||||
def get_by_id(cls, context, id):
|
||||
def get_by_id(cls, context, db_id):
|
||||
"""Find a volume connector based on its integer ID.
|
||||
|
||||
:param context: security context
|
||||
:param id: the integer (database primary key) ID of a volume connector
|
||||
:returns: a :class:`VolumeConnector` object
|
||||
:param context: Security context.
|
||||
:param db_id: The integer (database primary key) ID of a
|
||||
volume connector.
|
||||
:returns: A :class:`VolumeConnector` object.
|
||||
:raises: VolumeConnectorNotFound if no volume connector exists with
|
||||
the specified ID
|
||||
the specified ID.
|
||||
"""
|
||||
db_connector = cls.dbapi.get_volume_connector_by_id(id)
|
||||
db_connector = cls.dbapi.get_volume_connector_by_id(db_id)
|
||||
connector = VolumeConnector._from_db_object(cls(context), db_connector)
|
||||
return connector
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user