the check for status.status should happen before trying to log it
otherwise, if status.status is None, status.status.api_status will throw a TypeError Closes-Bug: #1287097 Change-Id: I62dafed59dcf8850808b22b8977d346607176403
This commit is contained in:
parent
cf5088b55f
commit
7a5051f967
|
@ -829,12 +829,12 @@ class Instances(object):
|
|||
|
||||
#volumes = find_volumes(server.id)
|
||||
status = InstanceServiceStatus.find_by(instance_id=db.id)
|
||||
LOG.info(_("Server api_status(%s)") %
|
||||
status.status.api_status)
|
||||
if not status.status: # This should never happen.
|
||||
LOG.error(_("Server status could not be read for "
|
||||
"instance id(%s)") % db.id)
|
||||
continue
|
||||
LOG.info(_("Server api_status(%s)") %
|
||||
status.status.api_status)
|
||||
except exception.ModelNotFoundError:
|
||||
LOG.error(_("Server status could not be read for "
|
||||
"instance id(%s)") % db.id)
|
||||
|
|
Loading…
Reference in New Issue