Fix undefined attribute in scenario test class

An attribute check is being performed: "if not self.image_ref"
but self.image_ref may not be defined at all, leading to the
following error. So, let's define it first so it can be properly
evaluated.

AttributeError: 'TestShareBasicOpsNFS' object
has no attribute 'image_ref'

TrivialFix

Change-Id: I0c454009b95c5cb0b6fc1304bb0cba1ff87c9fe9
This commit is contained in:
Rodrigo Barbieri 2016-12-12 09:17:47 -02:00
parent 9315928347
commit b66f04ed7e
1 changed files with 1 additions and 0 deletions

View File

@ -51,6 +51,7 @@ class ShareBasicOpsBase(manager.ShareScenarioTest):
base.verify_test_has_appropriate_tags(self)
# Setup image and flavor the test instance
# Support both configured and injected values
self.image_ref = None
if not hasattr(self, 'flavor_ref'):
self.flavor_ref = CONF.share.client_vm_flavor_ref
if CONF.share.image_with_share_tools: