66# to you under the Apache License, Version 2.0 (the
77# "License"); you may not use this file except in compliance
88# with the License. You may obtain a copy of the License at
9- #
9+ #
1010# http://www.apache.org/licenses/LICENSE-2.0
11- #
11+ #
1212# Unless required by applicable law or agreed to in writing,
1313# software distributed under the License is distributed on an
1414# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
2020
2121import marvin
2222from marvin .cloudstackTestCase import *
23- from marvin .remoteSSHClient import remoteSSHClient
23+ from marvin .remoteSSHClient import remoteSSHClient
2424import hashlib
2525import random
2626
2727class TestDeployVmWithAffinityGroup (cloudstackTestCase ):
2828 """
29- This test deploys a virtual machine into a user account
29+ This test deploys a virtual machine into a user account
3030 using the small service offering and builtin template
3131 """
3232 def setUp (self ):
@@ -57,7 +57,7 @@ def setUp(self):
5757 %s"% (self .acctResponse .account .account , \
5858 self .acctResponse .account .username , \
5959 self .acctResponse .account .id ))
60-
60+
6161
6262 self .zone = listZones .listZonesCmd ()
6363 self .zone .uuid = self .apiClient .listZones (self .zone )[0 ].id
@@ -68,28 +68,28 @@ def setUp(self):
6868 self .template = listTemplates .listTemplatesCmd ()
6969 self .template .templatefilter = 'featured'
7070 self .template .name = 'CentOS'
71- self .template .uuid = self .apiClient .listTemplates (self .template )[0 ].id
71+ self .template .uuid = self .apiClient .listTemplates (self .template )[0 ].id
7272
7373 def test_DeployVm (self ):
7474 """
7575 Let's start by defining the attributes of our VM that we will be
7676 deploying on CloudStack. We will be assuming a single zone is available
7777 and is configured and all templates are Ready
7878
79- The hardcoded values are used only for brevity.
80-
79+ The hardcoded values are used only for brevity.
80+
8181 First create the host anti-affinity group for this account
8282 """
8383 createAGCmd = createAffinityGroup .createAffinityGroupCmd ()
8484 createAGCmd .name = 'webvms1'
8585 createAGCmd .type = 'host anti-affinity'
8686 createAGCmd .account = self .acct .account
8787 createAGCmd .domainid = self .acct .domainid
88-
88+
8989 createAGResponse = self .apiClient .createAffinityGroup (createAGCmd )
9090 self .debug ("AffinityGroup %s was created in the job %s" % (createAGResponse .id , createAGResponse .jobid ))
91-
92-
91+
92+
9393 deployVmCmd = deployVirtualMachine .deployVirtualMachineCmd ()
9494 deployVmCmd .zoneid = self .zone .uuid
9595 deployVmCmd .templateid = self .template .uuid #CentOS 5.6 builtin
@@ -128,7 +128,7 @@ def test_DeployVm(self):
128128
129129 deployVm2Response = self .apiClient .deployVirtualMachine (deployVm2Cmd )
130130 self .debug ("VM2 %s was deployed in the job %s" % (deployVm2Response .id , deployVm2Response .jobid ))
131-
131+
132132 # At this point our VM is expected to be Running. Let's find out what
133133 # listVirtualMachines tells us about VMs in this account
134134
@@ -143,11 +143,11 @@ def test_DeployVm(self):
143143 self .assertEqual (vm2 .state , "Running" , "Check if VM has reached Running state in CS" )
144144
145145 VM2hostid = vm2 .hostid
146-
147- self .assertNotEqual (VM1hostid , VM2hostid , "The hosts of the 2 VM's in the host anti-affinity group are not different, test failed" )
148-
146+
147+ self .assertNotEqual (VM1hostid , VM2hostid , "The hosts of the 2 VM's in the host anti-affinity group are not different, test failed" )
148+
149149 def tearDown (self ):
150- """
150+ """
151151 And finally let us cleanup the resources we created by deleting the
152152 account. All good unittests are atomic and rerunnable this way
153153 """
0 commit comments