Merge "Add back policy check for CG"
This commit is contained in:
commit
286cd3c378
|
@ -84,6 +84,7 @@ class ConsistencyGroupsController(wsgi.Controller):
|
||||||
if isinstance(group, cg_obj.ConsistencyGroup):
|
if isinstance(group, cg_obj.ConsistencyGroup):
|
||||||
self.consistencygroup_api.delete(context, group, force)
|
self.consistencygroup_api.delete(context, group, force)
|
||||||
elif isinstance(group, grp_obj.Group):
|
elif isinstance(group, grp_obj.Group):
|
||||||
|
consistencygroup_api.api.check_policy(context, 'delete')
|
||||||
self.group_api.delete(context, group, force)
|
self.group_api.delete(context, group, force)
|
||||||
else:
|
else:
|
||||||
msg = _("Group '%s' not found.") % id
|
msg = _("Group '%s' not found.") % id
|
||||||
|
@ -184,6 +185,7 @@ class ConsistencyGroupsController(wsgi.Controller):
|
||||||
{'name': name})
|
{'name': name})
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
consistencygroup_api.api.check_policy(context, 'create')
|
||||||
new_consistencygroup = self.group_api.create(
|
new_consistencygroup = self.group_api.create(
|
||||||
context, name, description, group_type['id'], volume_types,
|
context, name, description, group_type['id'], volume_types,
|
||||||
availability_zone=availability_zone)
|
availability_zone=availability_zone)
|
||||||
|
@ -251,6 +253,7 @@ class ConsistencyGroupsController(wsgi.Controller):
|
||||||
context, name, description, cgsnapshot_id, source_cgid)
|
context, name, description, cgsnapshot_id, source_cgid)
|
||||||
elif (isinstance(src_grp, grp_obj.Group) or
|
elif (isinstance(src_grp, grp_obj.Group) or
|
||||||
isinstance(src_snap, grpsnap_obj.GroupSnapshot)):
|
isinstance(src_snap, grpsnap_obj.GroupSnapshot)):
|
||||||
|
consistencygroup_api.api.check_policy(context, 'create')
|
||||||
new_group = self.group_api.create_from_src(
|
new_group = self.group_api.create_from_src(
|
||||||
context, name, description, cgsnapshot_id, source_cgid)
|
context, name, description, cgsnapshot_id, source_cgid)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue