marvin: storagetype reference only when attr present

reference the storagetype only when present. storagetype is reqd only for
devcloud style tests
This commit is contained in:
Prasanna Santhanam 2012-12-09 23:13:24 -08:00
parent 7d4e65740b
commit e49b3b27de
3 changed files with 6 additions and 2 deletions

View File

@ -218,7 +218,7 @@ class TestISO(cloudstackTestCase):
cls.services["account"] = cls.account.account.name
# Finding the OsTypeId from Ostype
ostypes = list_os_types(
cls.apiclient,
cls.api_client,
description=self.services["ostype"]
)
if not isinstance(ostypes, list):

View File

@ -1039,7 +1039,8 @@ class ServiceOffering:
cmd.displaytext = services["displaytext"]
cmd.memory = services["memory"]
cmd.name = services["name"]
cmd.storagetype = services["storagetype"]
if hasattr(cmd, "storagetype"):
cmd.storagetype = services["storagetype"]
# Service Offering private to that domain
if domainid:

View File

@ -64,6 +64,7 @@ def get_domain(apiclient, services=None):
domains = apiclient.listDomains(cmd)
if isinstance(domains, list):
assert len(domains) > 0
return domains[0]
else:
raise Exception("Failed to find specified domain.")
@ -80,6 +81,7 @@ def get_zone(apiclient, services=None):
zones = apiclient.listZones(cmd)
if isinstance(zones, list):
assert len(zones) > 0
return zones[0]
else:
raise Exception("Failed to find specified zone.")
@ -98,6 +100,7 @@ def get_pod(apiclient, zoneid, services=None):
pods = apiclient.listPods(cmd)
if isinstance(pods, list):
assert len(pods) > 0
return pods[0]
else:
raise Exception("Exception: Failed to find specified pod.")