From 8fcd0fbe26442d36a2684b802bd41144b92f6888 Mon Sep 17 00:00:00 2001 From: peusterm Date: Thu, 29 Jun 2017 07:38:18 +0200 Subject: [PATCH] Added flavor and image delete endpoints --- .../openstack_dummies/nova_dummy_api.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/emuvim/api/openstack/openstack_dummies/nova_dummy_api.py b/src/emuvim/api/openstack/openstack_dummies/nova_dummy_api.py index f294617..c2394c8 100755 --- a/src/emuvim/api/openstack/openstack_dummies/nova_dummy_api.py +++ b/src/emuvim/api/openstack/openstack_dummies/nova_dummy_api.py @@ -520,6 +520,14 @@ class NovaListFlavorById(Resource): LOG.exception(u"%s: Could not retrieve flavor with id %s" % (__name__, flavorid)) return ex.message, 500 + def delete(self, id, flavorid): + """ + Removes the given flavor. + Does not really remove anything from the machine, just fakes an OK. + """ + LOG.debug("API CALL: %s GET" % str(self.__class__.__name__)) + return Response("{}", status=204, mimetype="application/json") + class NovaListImages(Resource): def __init__(self, api): @@ -634,6 +642,14 @@ class NovaListImageById(Resource): LOG.exception(u"%s: Could not retrieve image with id %s." % (__name__, imageid)) return ex.message, 500 + def delete(self, id, imageid): + """ + Removes the given image. + Does not really remove anything from the machine, just fakes an OK. + """ + LOG.debug("API CALL: %s GET" % str(self.__class__.__name__)) + return Response("{}", status=204, mimetype="application/json") + class NovaShowServerDetails(Resource): def __init__(self, api): -- 2.17.1