diff options
author | Takashi NATSUME <natsume.takashi@lab.ntt.co.jp> | 2018-04-03 09:37:51 +0900 |
---|---|---|
committer | Takashi NATSUME <natsume.takashi@lab.ntt.co.jp> | 2018-04-03 23:59:22 +0000 |
commit | e044b911c2f8a982a4514878762e01f3b668c18c (patch) | |
tree | c40c47fd1677ef38529fa46afe7cfe86f6d23ad3 | |
parent | d4df771868de9ba78baf94ed41b107ae3c1f7b2c (diff) | |
download | python-novaclient-e044b911c2f8a982a4514878762e01f3b668c18c.tar.gz |
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
-rw-r--r-- | novaclient/tests/functional/base.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/novaclient/tests/functional/base.py b/novaclient/tests/functional/base.py index 2c83f302..57f822b2 100644 --- a/novaclient/tests/functional/base.py +++ b/novaclient/tests/functional/base.py @@ -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.""" |