summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorRick Harris <rick.harris@rackspace.com>2011-08-05 22:29:28 +0000
committerRick Harris <rick.harris@rackspace.com>2011-08-05 22:29:28 +0000
commitc49e99a7fc590c2dde6125843d904895ca8861a3 (patch)
treee1af55d8622f5ef8ef18278a06c95fb98223580d /nova/api
parent9633e9877c7836c18c30b51c8494abfb025e64ca (diff)
Disable flag for V1 Openstack API
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/servers.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/nova/api/openstack/servers.py b/nova/api/openstack/servers.py
index 1051ba571..391c7d644 100644
--- a/nova/api/openstack/servers.py
+++ b/nova/api/openstack/servers.py
@@ -691,6 +691,12 @@ class ControllerV11(Controller):
def _action_create_image(self, input_dict, req, instance_id):
"""Snapshot a server instance."""
+ if not FLAGS.allow_instance_snapshots:
+ LOG.warn(_('Rejecting snapshot request, snapshots currently'
+ ' disabled'))
+ msg = _("Instance Snapshots are not permitted at this time.")
+ raise webob.exc.HTTPBadRequest(explanation=msg)
+
entity = input_dict.get("createImage", {})
try: