Attempting to shutdown an instance in "NOSTATE" gives misleading error message

Bug #1630581 reported by jichenjc
4
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Triaged
Low
Unassigned

Bug Description

I have a instance not in running state, it's in 'NOSTATE' for some reason, I am able to stop it in CLI but not able to stop in GUI, it tells me

'You are not allowed to shut off: xxxx'

this is misleading given info at
https://github.com/openstack/horizon/blob/master/horizon/tables/actions.py#L864

if policy don't allow me to do this ,we can tell it's
'You are not allowed to shut off: xxxx'

if it's because instance is not capable ,we should say something like
'xxxx not capable of action shut off' so it will be more helpful to debug and know the real cause

jichenjc (jichenjc)
Changed in horizon:
assignee: nobody → jichenjc (jichenjc)
Revision history for this message
jichenjc (jichenjc) wrote :

it's because we didn't distinguish policy check and state check result from line 136 to 138

 130
 131 def _allowed(self, request, datum):
 132 policy_check = getattr(settings, "POLICY_CHECK_FUNCTION", None)
 133
 134 if policy_check and self.policy_rules:
 135 target = self.get_policy_target(request, datum)
 136 return (policy_check(self.policy_rules, request, target) and
 137 self.allowed(request, datum))
 138 return self.allowed(request, datum)
 139

Changed in horizon:
assignee: jichenjc (jichenjc) → nobody
Praveen N (praveenn)
Changed in horizon:
assignee: nobody → Praveen N (praveenn)
assignee: Praveen N (praveenn) → nobody
tags: added: error-reporting
summary: - No state instance shutdown given misleading info
+ Attempting to shutdown an instance in "NOSTATE" gives misleading error
+ message
Changed in horizon:
importance: Undecided → Low
Revision history for this message
Vishal Manchanda (vishalmanchanda) wrote :
Changed in horizon:
status: New → Triaged
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.