def delete(volume_id): if volume_id == delete_disk_name: return delete_response elif volume_id == not_found_disk_name: raise CinderNotFound(**file_to_dict( 'tests/data/openstack/cinder.volumes.get.notfound.txt')) elif volume_id == invalid_disk_name: raise CinderForbidden(**file_to_dict( 'tests/data/openstack/cinder.delete.forbidden.txt'))
def get(snapshot_id): if snapshot_id == valid_snapshot_name: info = file_to_dict( 'tests/data/openstack/cinder.volume_snapshots.get.txt') return CinderSnapshot(None, info, True, None) elif snapshot_id == not_found_snapshot_name or snapshot_id == delete_snapshot_name: raise CinderNotFound(**file_to_dict( 'tests/data/openstack/cinder.volume_snapshots.get.notfound.txt' ))
def get(volume_id): if volume_id == valid_disk_name: info = file_to_dict( 'tests/data/openstack/cinder.volumes.get.txt') return CinderVolume(None, info, True, None) elif volume_id == detached_disk_name: info = file_to_dict( 'tests/data/openstack/cinder.volumes.get.detached.txt') return CinderVolume(None, info, True, None) elif volume_id == not_found_disk_name or volume_id == delete_disk_name: raise CinderNotFound(**file_to_dict( 'tests/data/openstack/cinder.volumes.get.notfound.txt'))