Fix status message inside validate_can_perform_action()

If we assign status with just self.db_info.task_status, we would get a
exception message like :
ERROR: Instance d6f3861d-21d2-4e96-9df1-64cf6439ea9c is not currently
available for an action to be performed (task status was (84 ERROR Build
error: guestagent timeout.)). (HTTP 422)

But here we actually need action only.

Change-Id: Iab69ba01937aa8e7a9be9e95e499d64891beed03
Signed-off-by: Fan Zhang <zh.f@outlook.com>
This commit is contained in:
Fan Zhang 2017-12-01 17:16:42 +08:00
parent ac1e7a17e0
commit 8c4605c3c7
1 changed files with 1 additions and 1 deletions

View File

@ -1261,7 +1261,7 @@ class Instance(BuiltInstance):
elif (self.db_info.task_status != InstanceTasks.NONE and
self.db_info.task_status != InstanceTasks.RESTART_REQUIRED):
status_type = 'task'
status = self.db_info.task_status
status = self.db_info.task_status.action
elif not self.datastore_status.status.action_is_allowed:
status = self.status
elif Backup.running(self.id):