Question
how enforce an updated policy in /etc/nova/policy.json
vi /etc/nova/policy.json
change
“computeextension:quotas:update”: “rule:adminapi”
to
“compute_extension:quotas:update”: “”
nc = nvclient.Client(authurl=os.environ[‘OSAUTHURL’],username=“hello@gmail.com”,apikey=“hello”,projectid=“MEDULLA”,authsystem=authsystem,authplugin=authplugin,cacert=os.environ['OSCACERT’])
nc.authenticate()
policy.enforce(nc,'quotas:update’,{'getall’:None})
policy.enforce(nc,'quotas:update’,{'getall’:None})
Traceback (most recent call last):
File “<stdin>”, line 1, in <module>
NameError: name 'policy’ is not defined
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×
got error in ice version python 2.7
dir(policyengine)
[’class’, ’delattr’, ’doc’, ’format’, ’getattribute’, ’hash’, ’init’, ’new’, ’reduce’, ’reduceex’, ’repr’, ’setattr’, ’sizeof’, ’str’, ’subclasshook__’]
https://review.openstack.org/gitweb?p=openstack/oslo-specs.git;a=commitdiff;h=17dc70a10053bd4231030c0ed5d9b0a377402b02