This branch prevents openstack-dashboard from erroring out when a netadmin tries to modify instance details. It also adds a proper error message for when users who try to terminate instances without permission.
This commit is contained in:
commit
b18bffe92c
|
@ -129,6 +129,8 @@ def terminate(request, project_id):
|
|||
messages.error(request,
|
||||
'Unable to terminate %s: %s' %
|
||||
(instance_id, e.message,))
|
||||
except exceptions.NovaUnauthorizedError, e:
|
||||
messages.error(request, 'Permission Denied')
|
||||
else:
|
||||
messages.success(request,
|
||||
'Instance %s has been terminated.' % instance_id)
|
||||
|
@ -190,6 +192,8 @@ def update(request, project_id, instance_id):
|
|||
messages.error(request,
|
||||
'Unable to update instance %s: %s' %
|
||||
(instance_id, e.message,))
|
||||
except exceptions.NovaUnauthorizedError, e:
|
||||
messages.error(request, 'Permission Denied')
|
||||
else:
|
||||
messages.success(request,
|
||||
'Instance %s has been updated.' % instance_id)
|
||||
|
|
Loading…
Reference in New Issue