diff --git a/test/integration/smoke/test_hosts.py b/test/integration/smoke/test_hosts.py index ec81d4c61ed..375529a1673 100644 --- a/test/integration/smoke/test_hosts.py +++ b/test/integration/smoke/test_hosts.py @@ -38,7 +38,7 @@ class TestHosts(cloudstackTestCase): self.dbclient = self.testClient.getDbConnection() self.services = self.testClient.getParsedTestDataConfig() self.zone = get_zone(self.apiclient, self.getZoneForTests()) - self.pod = get_pod(apilcient=self.apiclient, self.zone.id) + self.pod = get_pod(self.apiclient, self.zone.id) self.cleanup = [] return diff --git a/test/integration/smoke/test_multipleips_per_nic.py b/test/integration/smoke/test_multipleips_per_nic.py index 9b34b2cb7b3..6eb2d297a98 100644 --- a/test/integration/smoke/test_multipleips_per_nic.py +++ b/test/integration/smoke/test_multipleips_per_nic.py @@ -47,7 +47,7 @@ class TestDeployVM(cloudstackTestCase): self.apiclient = self.testClient.getApiClient() # Get Zone, Domain and Default Built-in template - self.domain = get_domain(self.apiclient)) + self.domain = get_domain(self.apiclient) self.zone = get_zone(self.apiclient, self.getZoneForTests()) self.testdata["mode"] = self.zone.networktype self.template = get_template(self.apiclient, self.zone.id, self.testdata["ostype"]) diff --git a/test/integration/smoke/test_network.py b/test/integration/smoke/test_network.py index 4cb1fb4c4b7..28707a350a9 100644 --- a/test/integration/smoke/test_network.py +++ b/test/integration/smoke/test_network.py @@ -18,7 +18,7 @@ """ #Import Local Modules import marvin -from marvin.cloudstackException import cloudstackAPIException +from marvin.cloudstackException import CloudstackAPIException from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * from marvin.sshClient import SshClient @@ -383,7 +383,7 @@ class TestPortForwarding(cloudstackTestCase): self.apiclient, id=nat_rule.id ) - except cloudstackAPIException: + except CloudstackAPIException: self.debug("Nat Rule is deleted") # Check if the Public SSH port is inaccessible @@ -501,7 +501,7 @@ class TestPortForwarding(cloudstackTestCase): self.apiclient, id=nat_rule.id ) - except cloudstackAPIException: + except CloudstackAPIException: self.debug("Nat Rule is deleted") # Check if the Public SSH port is inaccessible @@ -801,7 +801,7 @@ class TestReleaseIP(cloudstackTestCase): id=self.nat_rule.id ) self.debug("List NAT Rule response" + str(list_nat_rule)) - except cloudstackAPIException: + except CloudstackAPIException: self.debug("Port Forwarding Rule is deleted") # listLoadBalancerRules should not list @@ -812,7 +812,7 @@ class TestReleaseIP(cloudstackTestCase): id=self.lb_rule.id ) self.debug("List LB Rule response" + str(list_lb_rule)) - except cloudstackAPIException: + except CloudstackAPIException: self.debug("Port Forwarding Rule is deleted") # SSH Attempt though public IP should fail @@ -927,7 +927,7 @@ class TestDeleteAccount(cloudstackTestCase): account=self.account.name, domainid=self.account.domainid ) - except cloudstackAPIException: + except CloudstackAPIException: self.debug("Port Forwarding Rule is deleted") # ListPortForwardingRules should not @@ -938,7 +938,7 @@ class TestDeleteAccount(cloudstackTestCase): account=self.account.name, domainid=self.account.domainid ) - except cloudstackAPIException: + except CloudstackAPIException: self.debug("NATRule is deleted") #Retrieve router for the user account @@ -953,7 +953,7 @@ class TestDeleteAccount(cloudstackTestCase): None, "Check routers are properly deleted." ) - except cloudstackAPIException: + except CloudstackAPIException: self.debug("Router is deleted") except Exception as e: diff --git a/test/integration/smoke/test_vm_life_cycle.py b/test/integration/smoke/test_vm_life_cycle.py index 110a65a6ba4..f7316b26a57 100644 --- a/test/integration/smoke/test_vm_life_cycle.py +++ b/test/integration/smoke/test_vm_life_cycle.py @@ -679,7 +679,7 @@ class TestVMLifeCycle(cloudstackTestCase): try: #Unmount ISO - command = "umount %s" % "mount_dir + command = "umount %s" % mount_dir ssh_client.execute(command) except Exception as e: self.fail("SSH failed for virtual machine: %s - %s" % diff --git a/tools/marvin/marvin/integration/lib/common.py b/tools/marvin/marvin/integration/lib/common.py index e8cdfc11a88..4177b910755 100644 --- a/tools/marvin/marvin/integration/lib/common.py +++ b/tools/marvin/marvin/integration/lib/common.py @@ -161,8 +161,7 @@ def get_region(apiclient, region_id=None, region_name=None): if region_id is not None: cmd.id = region_id cmd_out = apiclient.listRegions(cmd) - return FAILED if validateList(cmd_out)[0] != PASS - return cmd_out + return FAILED if validateList(cmd_out)[0] != PASS else cmd_out def get_domain(apiclient, domain_id=None, domain_name=None): @@ -181,8 +180,7 @@ def get_domain(apiclient, domain_id=None, domain_name=None): if domain_id is not None: cmd.id = domain_id cmd_out = apiclient.listRegions(cmd) - return FAILED if validateList(cmd_out)[0] != PASS - return cmd_out + return FAILED if validateList(cmd_out)[0] != PASS else cmd_out def get_zone(apiclient, zone_name=None, zone_id=None): @@ -202,12 +200,12 @@ def get_zone(apiclient, zone_name=None, zone_id=None): cmd_out = apiclient.listZones(cmd) - return FAILED if (validateList(cmd_out)[0] != PASS) + if validateList(cmd_out)[0] != PASS: return FAILED ''' Check if input zone name and zone id is None, then return first element of List Zones command ''' - if ( zone_name is None and zone_id is None ) + if (zone_name is None and zone_id is None): return cmd_out[0] else: return cmd_out @@ -235,8 +233,7 @@ def get_pod(apiclient, zone_id=None, pod_id=None, pod_name=None): cmd_out = apiclient.listPods(cmd) - return FAILED if ( validateList(cmd_out)[0] != PASS ) - return cmd_out + return FAILED if (validateList(cmd_out)[0] != PASS) else cmd_out def get_template(apiclient, zone_id=None, ostype_desc=None, template_filter="featured", template_type='BUILTIN', @@ -259,7 +256,7 @@ def get_template(apiclient, zone_id=None, ostype_desc=None, template_filter="fea cmd.description = ostype_desc ostypes_out = apiclient.listOsTypes(cmd) - return FAILED if (validateList(ostypes_out)[0] != PASS ) + if (validateList(ostypes_out)[0] != PASS): return FAILED ostype_id = ostypes_out[0].id @@ -284,7 +281,7 @@ def get_template(apiclient, zone_id=None, ostype_desc=None, template_filter="fea Get the Templates pertaining ''' list_templatesout = apiclient.listTemplates(cmd) - return FAILED if validateList(list_templatesout)[0] != PASS + if validateList(list_templatesout)[0] != PASS: return FAILED for template in list_templatesout: if template.ostypeid == ostype_id and template.isready and template.templatetype == template_type: