CLOUDSTACK: 4640 - Fixed indentation issues in function createInstance

This commit is contained in:
Gaurav Aradhye 2013-09-10 03:00:10 -04:00 committed by sailajam
parent b35e76132d
commit 219c64eef3
2 changed files with 32 additions and 32 deletions

View File

@ -154,10 +154,10 @@ class TestCPULimits(cloudstackTestCase):
if api_client is None:
api_client = self.apiclient
self.debug("Deploying an instance in account: %s" %
self.debug("Deploying an instance in account: %s" %
self.account.name)
try:
vm = VirtualMachine.create(
try:
vm = VirtualMachine.create(
api_client,
self.services["virtual_machine"],
templateid=self.template.id,
@ -165,15 +165,15 @@ class TestCPULimits(cloudstackTestCase):
domainid=self.account.domainid,
networkids=networks,
serviceofferingid=service_off.id)
vms = VirtualMachine.list(api_client, id=vm.id, listall=True)
self.assertIsInstance(vms,
vms = VirtualMachine.list(api_client, id=vm.id, listall=True)
self.assertIsInstance(vms,
list,
"List VMs should return a valid response")
self.assertEqual(vms[0].state, "Running",
self.assertEqual(vms[0].state, "Running",
"Vm state should be running after deployment")
return vm
except Exception as e:
self.fail("Failed to deploy an instance: %s" % e)
return vm
except Exception as e:
self.fail("Failed to deploy an instance: %s" % e)
@attr(tags=["advanced", "advancedns","simulator"])
def test_01_multiplecore_start_stop_instance(self):
@ -401,10 +401,10 @@ class TestDomainCPULimitsConfiguration(cloudstackTestCase):
if api_client is None:
api_client = self.apiclient
self.debug("Deploying an instance in account: %s" %
self.debug("Deploying an instance in account: %s" %
self.account.name)
try:
vm = VirtualMachine.create(
try:
vm = VirtualMachine.create(
api_client,
self.services["virtual_machine"],
templateid=self.template.id,
@ -412,15 +412,15 @@ class TestDomainCPULimitsConfiguration(cloudstackTestCase):
domainid=self.account.domainid,
networkids=networks,
serviceofferingid=service_off.id)
vms = VirtualMachine.list(api_client, id=vm.id, listall=True)
self.assertIsInstance(vms,
vms = VirtualMachine.list(api_client, id=vm.id, listall=True)
self.assertIsInstance(vms,
list,
"List VMs should return a valid response")
self.assertEqual(vms[0].state, "Running",
self.assertEqual(vms[0].state, "Running",
"Vm state should be running after deployment")
return vm
except Exception as e:
self.fail("Failed to deploy an instance: %s" % e)
return vm
except Exception as e:
self.fail("Failed to deploy an instance: %s" % e)
def setupAccounts(self):

View File

@ -162,23 +162,23 @@ class TestProjectsCPULimits(cloudstackTestCase):
if api_client is None:
api_client = self.api_client
try:
self.vm = VirtualMachine.create(
api_client,
self.services["virtual_machine"],
templateid=self.template.id,
projectid=project.id,
networkids=networks,
serviceofferingid=service_off.id)
vms = VirtualMachine.list(api_client, id=self.vm.id, listall=True)
self.assertIsInstance(vms,
try:
self.vm = VirtualMachine.create(
api_client,
self.services["virtual_machine"],
templateid=self.template.id,
projectid=project.id,
networkids=networks,
serviceofferingid=service_off.id)
vms = VirtualMachine.list(api_client, id=self.vm.id, listall=True)
self.assertIsInstance(vms,
list,
"List VMs should return a valid response")
self.assertEqual(vms[0].state, "Running",
self.assertEqual(vms[0].state, "Running",
"Vm state should be running after deployment")
return self.vm
except Exception as e:
self.fail("Failed to deploy an instance: %s" % e)
return self.vm
except Exception as e:
self.fail("Failed to deploy an instance: %s" % e)
def setupProjectAccounts(self):