Skip to content

Commit e49b3b2

Browse files
author
Prasanna Santhanam
committed
marvin: storagetype reference only when attr present
reference the storagetype only when present. storagetype is reqd only for devcloud style tests
1 parent 7d4e657 commit e49b3b2

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

test/integration/smoke/test_iso.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ def setUpClass(cls):
218218
cls.services["account"] = cls.account.account.name
219219
# Finding the OsTypeId from Ostype
220220
ostypes = list_os_types(
221-
cls.apiclient,
221+
cls.api_client,
222222
description=self.services["ostype"]
223223
)
224224
if not isinstance(ostypes, list):

tools/marvin/marvin/integration/lib/base.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1039,7 +1039,8 @@ def create(cls, apiclient, services, domainid=None, **kwargs):
10391039
cmd.displaytext = services["displaytext"]
10401040
cmd.memory = services["memory"]
10411041
cmd.name = services["name"]
1042-
cmd.storagetype = services["storagetype"]
1042+
if hasattr(cmd, "storagetype"):
1043+
cmd.storagetype = services["storagetype"]
10431044

10441045
# Service Offering private to that domain
10451046
if domainid:

tools/marvin/marvin/integration/lib/common.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ def get_domain(apiclient, services=None):
6464
domains = apiclient.listDomains(cmd)
6565

6666
if isinstance(domains, list):
67+
assert len(domains) > 0
6768
return domains[0]
6869
else:
6970
raise Exception("Failed to find specified domain.")
@@ -80,6 +81,7 @@ def get_zone(apiclient, services=None):
8081
zones = apiclient.listZones(cmd)
8182

8283
if isinstance(zones, list):
84+
assert len(zones) > 0
8385
return zones[0]
8486
else:
8587
raise Exception("Failed to find specified zone.")
@@ -98,6 +100,7 @@ def get_pod(apiclient, zoneid, services=None):
98100
pods = apiclient.listPods(cmd)
99101

100102
if isinstance(pods, list):
103+
assert len(pods) > 0
101104
return pods[0]
102105
else:
103106
raise Exception("Exception: Failed to find specified pod.")

0 commit comments

Comments
 (0)