Ejemplo n.º 1
0
def get_int_id_from_snapshot_uuid(context, snapshot_uuid):
    if snapshot_uuid is None:
        return
    try:
        return db.get_ec2_snapshot_id_by_uuid(context, snapshot_uuid)
    except exception.NotFound:
        return db.ec2_snapshot_create(context, snapshot_uuid)['id']
Ejemplo n.º 2
0
def get_int_id_from_snapshot_uuid(context, snapshot_uuid):
    if snapshot_uuid is None:
        return
    try:
        return db.get_ec2_snapshot_id_by_uuid(context, snapshot_uuid)
    except exception.NotFound:
        return db.ec2_snapshot_create(context, snapshot_uuid)['id']
Ejemplo n.º 3
0
def get_int_id_from_snapshot_uuid(context, snapshot_uuid):
    if snapshot_uuid is None:
        return
    try:
        return db.get_ec2_snapshot_id_by_uuid(context, snapshot_uuid)
    except exception.NotFound:
        raise exception.SnapshotNotFound()
Ejemplo n.º 4
0
 def test_get_snap_mapping_non_admin(self):
     ref = db.ec2_snapshot_create(self.context, 'fake-uuid')
     ec2_id = db.get_ec2_snapshot_id_by_uuid(self.context, 'fake-uuid')
     self.assertEqual(ref['id'], ec2_id)
Ejemplo n.º 5
0
 def test_get_snap_mapping_non_admin(self):
     ref = db.ec2_snapshot_create(self.context, 'fake-uuid')
     ec2_id = db.get_ec2_snapshot_id_by_uuid(self.context, 'fake-uuid')
     self.assertEqual(ref['id'], ec2_id)