Skip to content

Instantly share code, notes, and snippets.

@vishvananda
Created December 10, 2011 21:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vishvananda/1456420 to your computer and use it in GitHub Desktop.
Save vishvananda/1456420 to your computer and use it in GitHub Desktop.
diff --git a/nova/compute/api.py b/nova/compute/api.py
index f65b5ce..01f5488 100644
--- a/nova/compute/api.py
+++ b/nova/compute/api.py
@@ -29,6 +29,7 @@ from nova import flags
import nova.image
from nova import log as logging
from nova import network
+from nova import policy
from nova import quota
from nova import rpc
from nova import utils
@@ -543,6 +544,9 @@ class API(base.Base):
we waited for information from the scheduler or not.
"""
+ policy.enforce(context,
+ 'compute.create_instance',
+ {'project_id': context.project_id})
# We can create the DB entry for the instance here if we're
# only going to create 1 instance and we're in a single
# zone deployment. This speeds up API responses for builds
@joshuamckenty
Copy link

should be compute:create_instance, not with a dot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment