def get(self, image): image_id = utils.get_id(image) for i in FAKE_IMAGES: if i.id == image_id: return i raise glance_exc.HTTPNotFound()
def get(self, server): server_id = utils.get_id(server) for server in self._fake_instances: if server.id == server_id: return server raise novaclient.exceptions.NotFound( novaclient.exceptions.NotFound.http_status)
def get(self, image): image_id = utils.get_id(image) for i in FAKE_IMAGES: if i.id == image_id: return i raise glance_exc.HTTPNotFound()
def get(self, flavor): flavor_id = utils.get_id(flavor) for flavor in FAKE_FLAVORS: if flavor.id == flavor_id: return flavor raise novaclient.exceptions.NotFound( novaclient.exceptions.NotFound.http_status)
def delete(self, image): image_id = utils.get_id(image) image_index = 0 for image in FAKE_IMAGES: if image.id != image_id: image_index += 1 continue del FAKE_IMAGES[image_index] return True raise glance_exc.HTTPNotFound()
def delete(self, image): image_id = utils.get_id(image) image_index = 0 for image in FAKE_IMAGES: if image.id != image_id: image_index += 1 continue del FAKE_IMAGES[image_index] return True raise glance_exc.HTTPNotFound()
def get(self, snapshot): snapshot_id = utils.get_id(snapshot) for snapshot in FAKE_SNAPSHOTS: if snapshot.id == snapshot_id: return snapshot raise exc.NotFound(exc.NotFound.http_status)
def delete(self, volume): global FAKE_DISKS volume_id = utils.get_id(volume) FAKE_DISKS = [v for v in FAKE_DISKS if v.id != volume_id]
def get(self, disk): disk_id = utils.get_id(disk) for disk in FAKE_DISKS: if disk.id == disk_id: return disk raise exc.NotFound(exc.NotFound.http_status)
def get(self, snapshot): snapshot_id = utils.get_id(snapshot) for snapshot in FAKE_SNAPSHOTS: if snapshot.id == snapshot_id: return snapshot raise exc.NotFound(exc.NotFound.http_status)
def delete(self, volume): global FAKE_DISKS volume_id = utils.get_id(volume) FAKE_DISKS = [v for v in FAKE_DISKS if v.id != volume_id]
def get(self, disk): disk_id = utils.get_id(disk) for disk in FAKE_DISKS: if disk.id == disk_id: return disk raise exc.NotFound(exc.NotFound.http_status)