Fix AttributeError in getting a resource ID
In the 'wait_for_resource_delete' method of the 'ClientTestBase' class, the following statement is executed when timeout. self.fail("The resource '%s' still exists." % resource.id) The 'resource' variable is passed in the argument of the 'wait_for_resource_delete' method. It is sometimes a string which is a resource ID. When it is a string (a resource ID), AttributeError is raised at the statement. This patch fixes the issue. Change-Id: I558026de54a5cc75359225b50054934a220f3e5c Closes-Bug: #1704132
This commit is contained in:
parent
d4df771868
commit
e044b911c2
|
@ -29,6 +29,7 @@ import testtools
|
|||
|
||||
import novaclient
|
||||
import novaclient.api_versions
|
||||
from novaclient import base
|
||||
import novaclient.client
|
||||
from novaclient.v2 import networks
|
||||
import novaclient.v2.shell
|
||||
|
@ -371,7 +372,7 @@ class ClientTestBase(testtools.TestCase):
|
|||
raise
|
||||
time.sleep(poll_interval)
|
||||
else:
|
||||
self.fail("The resource '%s' still exists." % resource.id)
|
||||
self.fail("The resource '%s' still exists." % base.getid(resource))
|
||||
|
||||
def name_generate(self):
|
||||
"""Generate randomized name for some entity."""
|
||||
|
|
Loading…
Reference in New Issue