You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ts...@apache.org on 2012/09/12 15:24:11 UTC

[27/37] Various fixes to tests

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/b433b1af/test/integration/component/test_projects.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_projects.py b/test/integration/component/test_projects.py
index 463cb4a..f0af670 100644
--- a/test/integration/component/test_projects.py
+++ b/test/integration/component/test_projects.py
@@ -44,7 +44,7 @@ class Services:
                                    "ipaddress": '192.168.100.21',
                                    "username": 'root',
                                    "password": 'fr3sca',
-                                   "port": 22,     
+                                   "port": 22,
                         },
                         "account": {
                                     "email": "administrator@clogeny.com",
@@ -76,8 +76,8 @@ class Services:
                                     "name": "Tiny Instance",
                                     "displaytext": "Tiny Instance",
                                     "cpunumber": 1,
-                                    "cpuspeed": 100, # in MHz
-                                    "memory": 64, # In MBs
+                                    "cpuspeed": 100,    # in MHz
+                                    "memory": 64,       # In MBs
                         },
                         "virtual_machine": {
                                     "displayname": "Test VM",
@@ -95,7 +95,7 @@ class Services:
                         # Cent OS 5.3 (64 bit)
                         "sleep": 60,
                         "timeout": 10,
-                        "mode":'advanced'
+                        "mode": 'advanced'
                     }
 
 
@@ -110,7 +110,7 @@ class TestMultipleProjectCreation(cloudstackTestCase):
         cls.services = Services().services
         # Get Zone
         cls.zone = get_zone(cls.api_client, cls.services)
-        
+
         # Create domains, account etc.
         cls.domain = get_domain(
                                    cls.api_client,
@@ -123,14 +123,14 @@ class TestMultipleProjectCreation(cloudstackTestCase):
                             admin=True,
                             domainid=cls.domain.id
                             )
-        
+
         cls.user = Account.create(
                             cls.api_client,
                             cls.services["account"],
                             admin=True,
                             domainid=cls.domain.id
                             )
-        
+
         cls._cleanup = [cls.account, cls.user]
         return
 
@@ -164,7 +164,7 @@ class TestMultipleProjectCreation(cloudstackTestCase):
 
         # Validate the following
         # 1. Create multiple project. Verify at step 1 An account is allowed
-        #    to create multiple projects 
+        #    to create multiple projects
         # 2. add one account to multiple project. Verify at step 2 an account
         #    is allowed to added to multiple project
 
@@ -182,7 +182,7 @@ class TestMultipleProjectCreation(cloudstackTestCase):
         self.assertEqual(
                     (config.value).lower(),
                     'false',
-                    "'project.invite.required' should be set to false" 
+                    "'project.invite.required' should be set to false"
                     )
 
         # Create project as a domain admin
@@ -196,9 +196,9 @@ class TestMultipleProjectCreation(cloudstackTestCase):
         self.cleanup.append(project_1)
         self.debug("Created project with domain admin with ID: %s" %
                                                                 project_1.id)
-        
+
         list_projects_reponse = Project.list(
-                                             self.apiclient, 
+                                             self.apiclient,
                                              id=project_1.id,
                                              listall=True
                                              )
@@ -231,9 +231,9 @@ class TestMultipleProjectCreation(cloudstackTestCase):
         self.cleanup.append(project_2)
         self.debug("Created project with domain user with ID: %s" %
                                                             project_2.id)
-        
+
         list_projects_reponse = Project.list(
-                                             self.apiclient, 
+                                             self.apiclient,
                                              id=project_2.id,
                                              listall=True
                                              )
@@ -250,17 +250,17 @@ class TestMultipleProjectCreation(cloudstackTestCase):
                         0,
                         "Check list project response returns a valid project"
                         )
-        
+
         # Add user to the project
         project_1.addAccount(
-                           self.apiclient, 
-                           self.user.account.name, 
+                           self.apiclient,
+                           self.user.account.name,
                            self.user.account.email
                            )
-        
+
         # listProjectAccount to verify the user is added to project or not
         accounts_reponse = Project.listAccounts(
-                                            self.apiclient, 
+                                            self.apiclient,
                                             projectid=project_1.id,
                                             account=self.user.account.name,
                                             )
@@ -270,14 +270,14 @@ class TestMultipleProjectCreation(cloudstackTestCase):
                             True,
                             "Check for a valid list accounts response"
                             )
-        
+
         self.assertNotEqual(
                     len(list_projects_reponse),
                     0,
                     "Check list project response returns a valid project"
                     )
         account = accounts_reponse[0]
-        
+
         self.assertEqual(
                             account.role,
                             'Regular',
@@ -285,14 +285,14 @@ class TestMultipleProjectCreation(cloudstackTestCase):
                             )
         # Add user to the project
         project_2.addAccount(
-                           self.apiclient, 
-                           self.user.account.name, 
+                           self.apiclient,
+                           self.user.account.name,
                            self.user.account.email
                            )
-        
+
         # listProjectAccount to verify the user is added to project or not
         accounts_reponse = Project.listAccounts(
-                                            self.apiclient, 
+                                            self.apiclient,
                                             projectid=project_2.id,
                                             account=self.user.account.name,
                                             )
@@ -302,14 +302,14 @@ class TestMultipleProjectCreation(cloudstackTestCase):
                             True,
                             "Check for a valid list accounts response"
                             )
-        
+
         self.assertNotEqual(
                     len(list_projects_reponse),
                     0,
                     "Check list project response returns a valid project"
                     )
         account = accounts_reponse[0]
-        
+
         self.assertEqual(
                             account.role,
                             'Regular',
@@ -346,14 +346,14 @@ class TestCrossDomainAccountAdd(cloudstackTestCase):
                             admin=True,
                             domainid=cls.domain.id
                             )
-        
+
         cls.user = Account.create(
                             cls.api_client,
                             cls.services["account"],
                             admin=True,
                             domainid=cls.new_domain.id
                             )
-        
+
         cls._cleanup = [cls.account, cls.user]
         return
 
@@ -403,7 +403,7 @@ class TestCrossDomainAccountAdd(cloudstackTestCase):
         self.assertEqual(
                     (config.value).lower(),
                     'false',
-                    "'project.invite.required' should be set to false" 
+                    "'project.invite.required' should be set to false"
                     )
 
         # Create project as a domain admin
@@ -417,9 +417,9 @@ class TestCrossDomainAccountAdd(cloudstackTestCase):
         self.cleanup.append(project)
         self.debug("Created project with domain admin with ID: %s" %
                                                                 project.id)
-        
+
         list_projects_reponse = Project.list(
-                                             self.apiclient, 
+                                             self.apiclient,
                                              id=project.id,
                                              listall=True
                                              )
@@ -442,8 +442,8 @@ class TestCrossDomainAccountAdd(cloudstackTestCase):
                             list_project.name,
                             "Check project name from list response"
                             )
-        
-        self.debug("Adding user: %s from domain: %s to project: %s" %(
+
+        self.debug("Adding user: %s from domain: %s to project: %s" % (
                                                     self.user.account.name,
                                                     self.user.account.domainid,
                                                     project.id
@@ -451,12 +451,12 @@ class TestCrossDomainAccountAdd(cloudstackTestCase):
         with self.assertRaises(Exception):
             # Add user to the project from different domain
             project.addAccount(
-                           self.apiclient, 
+                           self.apiclient,
                            self.user.account.name
                            )
             self.debug("User add to project failed!")
         return
-    
+
 
 class TestDeleteAccountWithProject(cloudstackTestCase):
 
@@ -530,7 +530,7 @@ class TestDeleteAccountWithProject(cloudstackTestCase):
         self.assertEqual(
                     (config.value).lower(),
                     'false',
-                    "'project.invite.required' should be set to false" 
+                    "'project.invite.required' should be set to false"
                     )
 
         # Create project as a domain admin
@@ -544,9 +544,9 @@ class TestDeleteAccountWithProject(cloudstackTestCase):
         self.cleanup.append(project)
         self.debug("Created project with domain admin with ID: %s" %
                                                                 project.id)
-        
+
         list_projects_reponse = Project.list(
-                                             self.apiclient, 
+                                             self.apiclient,
                                              id=project.id,
                                              listall=True
                                              )
@@ -572,10 +572,11 @@ class TestDeleteAccountWithProject(cloudstackTestCase):
         # Deleting account who is owner of the project
         with self.assertRaises(Exception):
             self.account.delete(self.apiclient)
-            self.debug("Deleting account %s failed!" % 
+            self.debug("Deleting account %s failed!" %
                                     self.account.account.name)
         return
 
+
 @unittest.skip("Deleting domain doesn't cleanup account")
 class TestDeleteDomainWithProject(cloudstackTestCase):
 
@@ -592,7 +593,7 @@ class TestDeleteDomainWithProject(cloudstackTestCase):
         cls.domain = Domain.create(
                                    cls.api_client,
                                    cls.services["domain"]
-                                   )    
+                                   )
 
         cls.account = Account.create(
                             cls.api_client,
@@ -650,7 +651,7 @@ class TestDeleteDomainWithProject(cloudstackTestCase):
         self.assertEqual(
                     (config.value).lower(),
                     'false',
-                    "'project.invite.required' should be set to false" 
+                    "'project.invite.required' should be set to false"
                     )
 
         # Create project as a domain admin
@@ -663,9 +664,9 @@ class TestDeleteDomainWithProject(cloudstackTestCase):
         # Cleanup created project at end of test
         self.debug("Created project with domain admin with ID: %s" %
                                                                 project.id)
-        
+
         list_projects_reponse = Project.list(
-                                             self.apiclient, 
+                                             self.apiclient,
                                              id=project.id,
                                              listall=True
                                              )
@@ -688,12 +689,12 @@ class TestDeleteDomainWithProject(cloudstackTestCase):
                             list_project.name,
                             "Check project name from list response"
                             )
-        
+
         self.debug("Deleting domain: %s forcefully" % self.domain.name)
         # Delete domain with cleanup=True
         self.domain.delete(self.apiclient, cleanup=True)
         self.debug("Removed domain: %s" % self.domain.name)
-        
+
         interval = list_configurations(
                                     self.apiclient,
                                     name='account.cleanup.interval'
@@ -704,14 +705,14 @@ class TestDeleteDomainWithProject(cloudstackTestCase):
                             "Check if account.cleanup.interval config present"
                         )
         self.debug(
-                "Sleep for account cleanup interval: %s" % 
+                "Sleep for account cleanup interval: %s" %
                                                     interval[0].value)
         # Sleep to ensure that all resources are deleted
         time.sleep(int(interval[0].value))
-        
+
         # Project should be deleted as part of domain cleanup
         list_projects_reponse = Project.list(
-                                             self.apiclient, 
+                                             self.apiclient,
                                              id=project.id,
                                              listall=True
                                              )
@@ -738,7 +739,7 @@ class TestProjectOwners(cloudstackTestCase):
                                    cls.services
                                    )
         cls.zone = get_zone(cls.api_client, cls.services)
-        
+
         # Create accounts
         cls.admin = Account.create(
                             cls.api_client,
@@ -777,7 +778,7 @@ class TestProjectOwners(cloudstackTestCase):
         except Exception as e:
             raise Exception("Warning: Exception during cleanup : %s" % e)
         return
-    
+
     def test_05_user_project_owner_promotion(self):
         """ Test Verify a project user can be later promoted to become a
             owner
@@ -803,7 +804,7 @@ class TestProjectOwners(cloudstackTestCase):
         self.assertEqual(
                     (config.value).lower(),
                     'false',
-                    "'project.invite.required' should be set to false" 
+                    "'project.invite.required' should be set to false"
                     )
 
         # Create project as a domain admin
@@ -817,9 +818,9 @@ class TestProjectOwners(cloudstackTestCase):
         # Cleanup created project at end of test
         self.debug("Created project with domain admin with ID: %s" %
                                                                 project.id)
-        
+
         list_projects_reponse = Project.list(
-                                             self.apiclient, 
+                                             self.apiclient,
                                              id=project.id,
                                              listall=True
                                              )
@@ -848,13 +849,13 @@ class TestProjectOwners(cloudstackTestCase):
                                                 ))
         # Add user to the project
         project.addAccount(
-                           self.apiclient, 
-                           self.new_admin.account.name, 
+                           self.apiclient,
+                           self.new_admin.account.name,
                            )
-        
+
         # listProjectAccount to verify the user is added to project or not
         accounts_reponse = Project.listAccounts(
-                                        self.apiclient, 
+                                        self.apiclient,
                                         projectid=project.id,
                                         account=self.new_admin.account.name,
                                         )
@@ -864,29 +865,29 @@ class TestProjectOwners(cloudstackTestCase):
                             True,
                             "Check for a valid list accounts response"
                             )
-        
+
         self.assertNotEqual(
                     len(list_projects_reponse),
                     0,
                     "Check list project response returns a valid project"
                     )
         account = accounts_reponse[0]
-        
+
         self.assertEqual(
                             account.role,
                             'Regular',
                             "Newly added user is not added as a regular user"
                             )
-        
+
         # Update the project with new admin
         project.update(
-                       self.apiclient, 
+                       self.apiclient,
                        account=self.new_admin.account.name
                        )
-        
+
         # listProjectAccount to verify the user is new admin of the project
         accounts_reponse = Project.listAccounts(
-                                        self.apiclient, 
+                                        self.apiclient,
                                         projectid=project.id,
                                         account=self.new_admin.account.name,
                                         )
@@ -896,23 +897,23 @@ class TestProjectOwners(cloudstackTestCase):
                             True,
                             "Check for a valid list accounts response"
                             )
-        
+
         self.assertNotEqual(
                     len(list_projects_reponse),
                     0,
                     "Check list project response returns a valid project"
                     )
         account = accounts_reponse[0]
-        
+
         self.assertEqual(
                             account.role,
                             'Admin',
                             "Newly added user is not added as a regular user"
                             )
-        
+
         # listProjectAccount to verify old user becomes a regular user
         accounts_reponse = Project.listAccounts(
-                                        self.apiclient, 
+                                        self.apiclient,
                                         projectid=project.id,
                                         account=self.admin.account.name,
                                         )
@@ -922,14 +923,14 @@ class TestProjectOwners(cloudstackTestCase):
                             True,
                             "Check for a valid list accounts response"
                             )
-        
+
         self.assertNotEqual(
                     len(list_projects_reponse),
                     0,
                     "Check list project response returns a valid project"
                     )
         account = accounts_reponse[0]
-        
+
         self.assertEqual(
                             account.role,
                             'Regular',
@@ -944,7 +945,7 @@ class TestProjectOwners(cloudstackTestCase):
         # Validate the following
         # 1. Create a project.
         # 2. Add account to the project. Edit account to make it a project
-        #    owner. 
+        #    owner.
         # 3. Update project to add another account as an owner
 
         # Verify 'project.invite.required' is set to false
@@ -961,7 +962,7 @@ class TestProjectOwners(cloudstackTestCase):
         self.assertEqual(
                     (config.value).lower(),
                     'false',
-                    "'project.invite.required' should be set to false" 
+                    "'project.invite.required' should be set to false"
                     )
 
         # Create project as a domain admin
@@ -976,9 +977,9 @@ class TestProjectOwners(cloudstackTestCase):
         self.debug("Created project with domain admin with ID: %s" %
                                                                 project.id)
         self.user = Account.create(
-                              self.apiclient, 
+                              self.apiclient,
                               self.services["account"],
-                              admin=True, 
+                              admin=True,
                               domainid=self.domain.id
                               )
         self.cleanup.append(self.user)
@@ -986,7 +987,7 @@ class TestProjectOwners(cloudstackTestCase):
                                                 self.user.account.name)
 
         list_projects_reponse = Project.list(
-                                             self.apiclient, 
+                                             self.apiclient,
                                              id=project.id,
                                              listall=True
                                              )
@@ -1015,13 +1016,13 @@ class TestProjectOwners(cloudstackTestCase):
                                                 ))
         # Add user to the project
         project.addAccount(
-                           self.apiclient, 
-                           self.new_admin.account.name, 
+                           self.apiclient,
+                           self.new_admin.account.name,
                            )
-        
+
         # listProjectAccount to verify the user is added to project or not
         accounts_reponse = Project.listAccounts(
-                                        self.apiclient, 
+                                        self.apiclient,
                                         projectid=project.id,
                                         account=self.new_admin.account.name,
                                         )
@@ -1031,30 +1032,30 @@ class TestProjectOwners(cloudstackTestCase):
                             True,
                             "Check for a valid list accounts response"
                             )
-        
+
         self.assertNotEqual(
                     len(list_projects_reponse),
                     0,
                     "Check list project response returns a valid project"
                     )
         account = accounts_reponse[0]
-        
+
         self.assertEqual(
                             account.role,
                             'Regular',
                             "Newly added user is not added as a regular user"
                             )
-        self.debug("Updating project with new Admin: %s" % 
+        self.debug("Updating project with new Admin: %s" %
                                                 self.new_admin.account.name)
         # Update the project with new admin
         project.update(
-                       self.apiclient, 
+                       self.apiclient,
                        account=self.new_admin.account.name
                        )
-        
+
         # listProjectAccount to verify the user is new admin of the project
         accounts_reponse = Project.listAccounts(
-                                        self.apiclient, 
+                                        self.apiclient,
                                         projectid=project.id,
                                         account=self.new_admin.account.name,
                                         )
@@ -1063,33 +1064,33 @@ class TestProjectOwners(cloudstackTestCase):
                             True,
                             "Check for a valid list accounts response"
                             )
-        
+
         self.assertNotEqual(
                     len(list_projects_reponse),
                     0,
                     "Check list project response returns a valid project"
                     )
         account = accounts_reponse[0]
-        
+
         self.assertEqual(
                             account.role,
                             'Admin',
                             "Newly added user is not added as a regular user"
                             )
-        
+
         self.debug("Adding %s user to project: %s" % (
                                                 self.user.account.name,
                                                 project.name
                                                 ))
         # Add user to the project
         project.addAccount(
-                           self.apiclient, 
-                           self.user.account.name, 
+                           self.apiclient,
+                           self.user.account.name,
                            )
-        
+
         # listProjectAccount to verify the user is added to project or not
         accounts_reponse = Project.listAccounts(
-                                        self.apiclient, 
+                                        self.apiclient,
                                         projectid=project.id,
                                         account=self.user.account.name,
                                         )
@@ -1098,32 +1099,32 @@ class TestProjectOwners(cloudstackTestCase):
                             True,
                             "Check for a valid list accounts response"
                             )
-        
+
         self.assertNotEqual(
                     len(list_projects_reponse),
                     0,
                     "Check list project response returns a valid project"
                     )
         account = accounts_reponse[0]
-        
+
         self.assertEqual(
                             account.role,
                             'Regular',
                             "Newly added user is not added as a regular user"
                             )
 
-        self.debug("Updating project with new Admin: %s" % 
+        self.debug("Updating project with new Admin: %s" %
                                                 self.user.account.name)
 
         # Update the project with new admin
         project.update(
-                       self.apiclient, 
+                       self.apiclient,
                        account=self.user.account.name
                        )
-        
+
         # listProjectAccount to verify the user is new admin of the project
         accounts_reponse = Project.listAccounts(
-                                        self.apiclient, 
+                                        self.apiclient,
                                         projectid=project.id,
                                         account=self.user.account.name,
                                         )
@@ -1133,23 +1134,23 @@ class TestProjectOwners(cloudstackTestCase):
                             True,
                             "Check for a valid list accounts response"
                             )
-        
+
         self.assertNotEqual(
                     len(list_projects_reponse),
                     0,
                     "Check list project response returns a valid project"
                     )
         account = accounts_reponse[0]
-        
+
         self.assertEqual(
                             account.role,
                             'Admin',
                             "Newly added user is not added as a regular user"
                             )
-       
+
        # listProjectAccount to verify old user becomes a regular user
         accounts_reponse = Project.listAccounts(
-                                        self.apiclient, 
+                                        self.apiclient,
                                         projectid=project.id,
                                         account=self.new_admin.account.name,
                                         )
@@ -1158,14 +1159,14 @@ class TestProjectOwners(cloudstackTestCase):
                             True,
                             "Check for a valid list accounts response"
                             )
-        
+
         self.assertNotEqual(
                     len(list_projects_reponse),
                     0,
                     "Check list project response returns a valid project"
                     )
         account = accounts_reponse[0]
-        
+
         self.assertEqual(
                             account.role,
                             'Regular',
@@ -1195,7 +1196,7 @@ class TestProjectResources(cloudstackTestCase):
                                     cls.api_client,
                                     cls.services["disk_offering"]
                                     )
-        
+
         cls.account = Account.create(
                             cls.api_client,
                             cls.services["account"],
@@ -1233,7 +1234,7 @@ class TestProjectResources(cloudstackTestCase):
         except Exception as e:
             raise Exception("Warning: Exception during cleanup : %s" % e)
         return
-    
+
     def test_07_project_resources_account_delete(self):
         """ Test Verify after an account is removed from the project, all his
             resources stay with the project.
@@ -1259,7 +1260,7 @@ class TestProjectResources(cloudstackTestCase):
         self.assertEqual(
                     (config.value).lower(),
                     'false',
-                    "'project.invite.required' should be set to false" 
+                    "'project.invite.required' should be set to false"
                     )
 
         # Create project as a domain admin
@@ -1273,9 +1274,9 @@ class TestProjectResources(cloudstackTestCase):
         self.cleanup.append(project)
         self.debug("Created project with domain admin with ID: %s" %
                                                                 project.id)
-        
+
         list_projects_reponse = Project.list(
-                                             self.apiclient, 
+                                             self.apiclient,
                                              id=project.id,
                                              listall=True
                                              )
@@ -1304,13 +1305,13 @@ class TestProjectResources(cloudstackTestCase):
                                                 ))
         # Add user to the project
         project.addAccount(
-                           self.apiclient, 
-                           self.user.account.name, 
+                           self.apiclient,
+                           self.user.account.name,
                            )
-        
+
         # listProjectAccount to verify the user is added to project or not
         accounts_reponse = Project.listAccounts(
-                                        self.apiclient, 
+                                        self.apiclient,
                                         projectid=project.id,
                                         account=self.user.account.name,
                                         )
@@ -1319,14 +1320,14 @@ class TestProjectResources(cloudstackTestCase):
                             True,
                             "Check for a valid list accounts response"
                             )
-        
+
         self.assertNotEqual(
                     len(list_projects_reponse),
                     0,
                     "Check list project response returns a valid project"
                     )
         account = accounts_reponse[0]
-        
+
         self.assertEqual(
                             account.role,
                             'Regular',
@@ -1334,39 +1335,39 @@ class TestProjectResources(cloudstackTestCase):
                             )
         # Create some resources(volumes) for the projects
         volume = Volume.create(
-                               self.apiclient, 
-                               self.services["volume"], 
-                               zoneid=self.zone.id, 
-                               diskofferingid=self.disk_offering.id, 
+                               self.apiclient,
+                               self.services["volume"],
+                               zoneid=self.zone.id,
+                               diskofferingid=self.disk_offering.id,
                                projectid=project.id
                                )
         self.cleanup.append(volume)
 
         # Delete the project user
         self.user.delete(self.apiclient)
-        
+
         volumes = Volume.list(self.apiclient, id=volume.id)
-        
+
         self.assertEqual(
                             isinstance(volumes, list),
                             True,
                             "Check for a valid list volumes response"
                             )
-        
+
         self.assertNotEqual(
                     len(volumes),
                     0,
                     "Check list volumes API response returns a valid list"
                     )
         volume_response = volumes[0]
-        
+
         self.assertEqual(
                          volume_response.name,
                          volume.name,
                          "Volume should exist after project user deletion."
                         )
         return
-    
+
     def test_08_cleanup_after_project_delete(self):
         """ Test accounts are unassigned from project after project deletion
         """
@@ -1392,7 +1393,7 @@ class TestProjectResources(cloudstackTestCase):
         self.assertEqual(
                     (config.value).lower(),
                     'false',
-                    "'project.invite.required' should be set to false" 
+                    "'project.invite.required' should be set to false"
                     )
 
         # Create project as a domain admin
@@ -1405,9 +1406,9 @@ class TestProjectResources(cloudstackTestCase):
         # Cleanup created project at end of test
         self.debug("Created project with domain admin with ID: %s" %
                                                                 project.id)
-        
+
         list_projects_reponse = Project.list(
-                                             self.apiclient, 
+                                             self.apiclient,
                                              id=project.id,
                                              listall=True
                                              )
@@ -1443,13 +1444,13 @@ class TestProjectResources(cloudstackTestCase):
                                                 ))
         # Add user to the project
         project.addAccount(
-                           self.apiclient, 
+                           self.apiclient,
                            self.user.account.name
                            )
-        
+
         # listProjectAccount to verify the user is added to project or not
         accounts_reponse = Project.listAccounts(
-                                        self.apiclient, 
+                                        self.apiclient,
                                         projectid=project.id,
                                         account=self.user.account.name,
                                         )
@@ -1458,14 +1459,14 @@ class TestProjectResources(cloudstackTestCase):
                             True,
                             "Check for a valid list accounts response"
                             )
-        
+
         self.assertNotEqual(
                     len(list_projects_reponse),
                     0,
                     "Check list project response returns a valid project"
                     )
         account = accounts_reponse[0]
-        
+
         self.assertEqual(
                             account.role,
                             'Regular',
@@ -1473,10 +1474,10 @@ class TestProjectResources(cloudstackTestCase):
                             )
         # Create some resources(volumes) for the projects
         volume = Volume.create(
-                               self.apiclient, 
-                               self.services["volume"], 
-                               zoneid=self.zone.id, 
-                               diskofferingid=self.disk_offering.id, 
+                               self.apiclient,
+                               self.services["volume"],
+                               zoneid=self.zone.id,
+                               diskofferingid=self.disk_offering.id,
                                projectid=project.id
                                )
         self.debug("Created a volume: %s for project: %s" % (
@@ -1487,17 +1488,17 @@ class TestProjectResources(cloudstackTestCase):
         self.debug("Deleting project: %s" % project.name)
         project.delete(self.apiclient)
         self.debug("Successfully deleted project: %s" % project.name)
-        
+
         volumes = Volume.list(self.apiclient, id=volume.id)
-        
+
         self.assertEqual(
                     volumes,
                     None,
                     "Resources (volume) should be deleted as part of cleanup"
                     )
-        
+
         accounts = Project.listAccounts(self.apiclient, projectid=project.id)
-        
+
         self.assertEqual(
                          accounts,
                          None,
@@ -1522,8 +1523,8 @@ class TestProjectSuspendActivate(cloudstackTestCase):
                                    cls.services
                                    )
         cls.template = get_template(
-                                    cls.api_client, 
-                                    cls.zone.id, 
+                                    cls.api_client,
+                                    cls.zone.id,
                                     cls.services["ostypeid"]
                                     )
         # Create account, service offering, disk offering etc.
@@ -1548,7 +1549,7 @@ class TestProjectSuspendActivate(cloudstackTestCase):
                             admin=True,
                             domainid=cls.domain.id
                             )
-        
+
         # Create project as a domain admin
         cls.project = Project.create(
                                  cls.api_client,
@@ -1587,7 +1588,7 @@ class TestProjectSuspendActivate(cloudstackTestCase):
         except Exception as e:
             raise Exception("Warning: Exception during cleanup : %s" % e)
         return
-    
+
     def test_09_project_suspend(self):
         """ Test Verify after an account is removed from the project, all his
             resources stay with the project.
@@ -1613,7 +1614,7 @@ class TestProjectSuspendActivate(cloudstackTestCase):
         self.assertEqual(
                     (config.value).lower(),
                     'false',
-                    "'project.invite.required' should be set to false" 
+                    "'project.invite.required' should be set to false"
                     )
 
         self.debug("Adding %s user to project: %s" % (
@@ -1622,13 +1623,13 @@ class TestProjectSuspendActivate(cloudstackTestCase):
                                                 ))
         # Add user to the project
         self.project.addAccount(
-                           self.apiclient, 
-                           self.user.account.name, 
+                           self.apiclient,
+                           self.user.account.name,
                            )
-        
+
         # listProjectAccount to verify the user is added to project or not
         accounts_reponse = Project.listAccounts(
-                                        self.apiclient, 
+                                        self.apiclient,
                                         projectid=self.project.id,
                                         account=self.user.account.name,
                                         )
@@ -1637,20 +1638,20 @@ class TestProjectSuspendActivate(cloudstackTestCase):
                             True,
                             "Check for a valid list accounts response"
                             )
-        
+
         self.assertNotEqual(
                     len(accounts_reponse),
                     0,
                     "Check list project response returns a valid project"
                     )
         account = accounts_reponse[0]
-        
+
         self.assertEqual(
                             account.role,
                             'Regular',
                             "Newly added user is not added as a regular user"
                             )
-        
+
         virtual_machine = VirtualMachine.create(
                                 self.apiclient,
                                 self.services["virtual_machine"],
@@ -1664,7 +1665,7 @@ class TestProjectSuspendActivate(cloudstackTestCase):
                                                          ))
         self.debug("Suspending a project: %s" % self.project.name)
         self.project.suspend(self.apiclient)
-        
+
         # Check status of all VMs associated with project
         vms = VirtualMachine.list(
                                   self.apiclient,
@@ -1676,13 +1677,13 @@ class TestProjectSuspendActivate(cloudstackTestCase):
                             True,
                             "Check for a valid list accounts response"
                             )
-        
+
         self.assertNotEqual(
                     len(vms),
                     0,
                     "Check list project response returns a valid project"
                     )
-        
+
         for vm in vms:
             self.debug("VM ID: %s state: %s" % (vm.id, vm.state))
             self.assertEqual(
@@ -1691,30 +1692,30 @@ class TestProjectSuspendActivate(cloudstackTestCase):
                     "VM should be in stopped state after project suspension"
                     )
 
-        self.debug("Attempting to create volume in suspended project")  
+        self.debug("Attempting to create volume in suspended project")
         with self.assertRaises(Exception):
             # Create some resources(volumes) for the projects
             volume = Volume.create(
-                               self.apiclient, 
-                               self.services["volume"], 
-                               zoneid=self.zone.id, 
-                               diskofferingid=self.disk_offering.id, 
+                               self.apiclient,
+                               self.services["volume"],
+                               zoneid=self.zone.id,
+                               diskofferingid=self.disk_offering.id,
                                projectid=self.project.id
                                )
-        
+
         self.debug("Volume creation failed")
 
         # Start the stopped VM
-        self.debug("Attempting to start VM: %s in suspended project" % 
-                                                        virtual_machine.id) 
+        self.debug("Attempting to start VM: %s in suspended project" %
+                                                        virtual_machine.id)
         with self.assertRaises(Exception):
             virtual_machine.start(self.apiclient)
         self.debug("VM start failed!")
-        
+
         # Destroy Stopped VM
         virtual_machine.delete(self.apiclient)
         self.debug("Destroying VM: %s" % virtual_machine.id)
-        
+
         # Check status of all VMs associated with project
         vms = VirtualMachine.list(
                                   self.apiclient,
@@ -1726,13 +1727,13 @@ class TestProjectSuspendActivate(cloudstackTestCase):
                             True,
                             "Check for a valid list accounts response"
                             )
-        
+
         self.assertNotEqual(
                     len(vms),
                     0,
                     "Check list project response returns a valid project"
                     )
-        
+
         for vm in vms:
             self.debug("VM ID: %s state: %s" % (vm.id, vm.state))
             self.assertEqual(
@@ -1743,12 +1744,12 @@ class TestProjectSuspendActivate(cloudstackTestCase):
         return
 
     def test_10_project_activation(self):
-        """ Test project activation after suspension 
+        """ Test project activation after suspension
         """
 
         # Validate the following
         # 1. Activate the project
-        # 2. Verify project is activated and we are able to add resources 
+        # 2. Verify project is activated and we are able to add resources
 
         # Verify 'project.invite.required' is set to false
         configs = Configurations.list(
@@ -1764,13 +1765,13 @@ class TestProjectSuspendActivate(cloudstackTestCase):
         self.assertEqual(
                     (config.value).lower(),
                     'false',
-                    "'project.invite.required' should be set to false" 
+                    "'project.invite.required' should be set to false"
                     )
 
         # Activating the project
         self.debug("Activating project: %s" % self.project.name)
         self.project.activate(self.apiclient)
-        
+
         virtual_machine = VirtualMachine.create(
                                 self.apiclient,
                                 self.services["virtual_machine"],
@@ -1778,7 +1779,7 @@ class TestProjectSuspendActivate(cloudstackTestCase):
                                 serviceofferingid=self.service_offering.id,
                                 projectid=self.project.id
                                 )
-        
+
         self.cleanup.append(virtual_machine)
         self.debug("Created a VM: %s for project: %s" % (
                                                          virtual_machine.id,
@@ -1795,13 +1796,13 @@ class TestProjectSuspendActivate(cloudstackTestCase):
                             True,
                             "Check for a valid list accounts response"
                             )
-        
+
         self.assertNotEqual(
                     len(vms),
                     0,
                     "Check list project response returns a valid project"
                     )
-        
+
         for vm in vms:
             self.debug("VM ID: %s state: %s" % (vm.id, vm.state))
             self.assertEqual(

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/b433b1af/test/integration/component/test_resource_limits.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_resource_limits.py b/test/integration/component/test_resource_limits.py
index c7290ba..12a8105 100644
--- a/test/integration/component/test_resource_limits.py
+++ b/test/integration/component/test_resource_limits.py
@@ -25,6 +25,7 @@ from integration.lib.base import *
 from integration.lib.common import *
 import datetime
 
+
 class Services:
     """Test Resource Limits Services
     """
@@ -47,8 +48,8 @@ class Services:
                                     "name": "Tiny Instance",
                                     "displaytext": "Tiny Instance",
                                     "cpunumber": 1,
-                                    "cpuspeed": 100, # in MHz
-                                    "memory": 64, # In MBs
+                                    "cpuspeed": 100,    # in MHz
+                                    "memory": 64,       # In MBs
                         },
                         "disk_offering": {
                                     "displaytext": "Small",
@@ -81,6 +82,7 @@ class Services:
                         "mode": 'advanced',
                     }
 
+
 class TestResourceLimitsAccount(cloudstackTestCase):
 
     @classmethod
@@ -153,7 +155,7 @@ class TestResourceLimitsAccount(cloudstackTestCase):
     def test_01_vm_per_account(self):
         """Test VM limit per account
         """
-        tags = ["advanced","advancedns"]
+        tags = ["advanced", "advancedns"]
 
         # Validate the following
         # 1. Set user_vm=1 limit for account 1.
@@ -162,18 +164,18 @@ class TestResourceLimitsAccount(cloudstackTestCase):
         # 3. Try to start 2 VMs account 2. Verify 2 SM are started properly
 
         self.debug(
-            "Updating instance resource limit for account: %s" % 
+            "Updating instance resource limit for account: %s" %
                                                 self.account_1.account.name)
         # Set usage_vm=1 for Account 1
         update_resource_limit(
                               self.apiclient,
-                              0, # Instance
+                              0,    # Instance
                               account=self.account_1.account.name,
                               domainid=self.account_1.account.domainid,
                               max=1
                               )
         self.debug(
-            "Deploying VM instance in account: %s" % 
+            "Deploying VM instance in account: %s" %
                                         self.account_1.account.name)
 
         virtual_machine = VirtualMachine.create(
@@ -204,7 +206,7 @@ class TestResourceLimitsAccount(cloudstackTestCase):
                                 serviceofferingid=self.service_offering.id
                                 )
         self.debug(
-            "Deploying VM instance in account: %s" % 
+            "Deploying VM instance in account: %s" %
                                         self.account_2.account.name)
         # Start 2 instances for account_2
         virtual_machine_1 = VirtualMachine.create(
@@ -224,7 +226,7 @@ class TestResourceLimitsAccount(cloudstackTestCase):
                         )
 
         self.debug(
-            "Deploying VM instance in account: %s" % 
+            "Deploying VM instance in account: %s" %
                                         self.account_2.account.name)
         virtual_machine_2 = VirtualMachine.create(
                                 self.apiclient,
@@ -246,7 +248,7 @@ class TestResourceLimitsAccount(cloudstackTestCase):
     def test_02_publicip_per_account(self):
         """Test Public IP limit per account
         """
-        tags = ["advanced","advancedns"]
+        tags = ["advanced", "advancedns"]
 
         # Validate the following
         # 1. Set Public_IP= 2 limit for account 1.
@@ -256,21 +258,21 @@ class TestResourceLimitsAccount(cloudstackTestCase):
         #    denied to acquire more than one IP.
         # 5. Acquire 2 IP in account 2. Verify account 2 should be able to
         #    Acquire IP without any warning
-        
+
         self.debug(
-            "Updating public IP resource limit for account: %s" % 
+            "Updating public IP resource limit for account: %s" %
                                                 self.account_1.account.name)
         # Set usage_vm=1 for Account 1
         update_resource_limit(
                               self.apiclient,
-                              1, # Public Ip
+                              1,    # Public Ip
                               account=self.account_1.account.name,
                               domainid=self.account_1.account.domainid,
                               max=2
                               )
 
         self.debug(
-            "Deploying VM instance in account: %s" % 
+            "Deploying VM instance in account: %s" %
                                         self.account_1.account.name)
         virtual_machine_1 = VirtualMachine.create(
                                 self.apiclient,
@@ -289,7 +291,7 @@ class TestResourceLimitsAccount(cloudstackTestCase):
                         )
 
         self.debug(
-            "Deploying VM instance in account: %s" % 
+            "Deploying VM instance in account: %s" %
                                         self.account_2.account.name)
         # Create VM for second account
         virtual_machine_2 = VirtualMachine.create(
@@ -308,7 +310,7 @@ class TestResourceLimitsAccount(cloudstackTestCase):
                             "Check VM state is Running or not"
                         )
         self.debug(
-            "Associating public IP for account: %s" % 
+            "Associating public IP for account: %s" %
                                         virtual_machine_1.account)
         public_ip_1 = PublicIPAddress.create(
                                            self.apiclient,
@@ -343,7 +345,7 @@ class TestResourceLimitsAccount(cloudstackTestCase):
                                            )
 
         self.debug(
-            "Associating public IP for account: %s" % 
+            "Associating public IP for account: %s" %
                                         virtual_machine_2.account)
         # Assign Public IP for account 2
         public_ip_3 = PublicIPAddress.create(
@@ -365,7 +367,7 @@ class TestResourceLimitsAccount(cloudstackTestCase):
                             "Check Public IP state is allocated or not"
                         )
         self.debug(
-            "Associating public IP for account: %s" % 
+            "Associating public IP for account: %s" %
                                         virtual_machine_2.account)
         public_ip_4 = PublicIPAddress.create(
                                            self.apiclient,
@@ -389,7 +391,7 @@ class TestResourceLimitsAccount(cloudstackTestCase):
     def test_03_snapshots_per_account(self):
         """Test Snapshot limit per account
         """
-        tags = ["advanced","advancedns"]
+        tags = ["advanced", "advancedns"]
 
         # Validate the following
         # 1. Set snapshot= 2 limit for account 1.
@@ -401,19 +403,19 @@ class TestResourceLimitsAccount(cloudstackTestCase):
         #    create snapshots without any warning
 
         self.debug(
-            "Updating public IP resource limit for account: %s" % 
+            "Updating public IP resource limit for account: %s" %
                                                 self.account_1.account.name)
         # Set usage_vm=1 for Account 1
         update_resource_limit(
                               self.apiclient,
-                              3, # Snapshot
+                              3,    # Snapshot
                               account=self.account_1.account.name,
                               domainid=self.account_1.account.domainid,
                               max=1
                               )
 
         self.debug(
-            "Deploying VM instance in account: %s" % 
+            "Deploying VM instance in account: %s" %
                                         self.account_1.account.name)
         virtual_machine_1 = VirtualMachine.create(
                                 self.apiclient,
@@ -432,7 +434,7 @@ class TestResourceLimitsAccount(cloudstackTestCase):
                         )
 
         self.debug(
-            "Deploying VM instance in account: %s" % 
+            "Deploying VM instance in account: %s" %
                                         self.account_1.account.name)
         # Create VM for second account
         virtual_machine_2 = VirtualMachine.create(
@@ -504,7 +506,7 @@ class TestResourceLimitsAccount(cloudstackTestCase):
                         "Check for list volume response return valid data"
                         )
         volume = volumes[0]
-        
+
         self.debug("Creating snapshot from volume: %s" % volumes[0].id)
         # Create a snapshot from the ROOTDISK (Account 2)
         snapshot_2 = Snapshot.create(self.apiclient,
@@ -545,7 +547,7 @@ class TestResourceLimitsAccount(cloudstackTestCase):
     def test_04_volumes_per_account(self):
         """Test Volumes limit per account
         """
-        tags = ["advanced","advancedns"]
+        tags = ["advanced", "advancedns"]
 
         # Validate the following
         # 1. Set volumes=2 limit for account 1.
@@ -557,12 +559,12 @@ class TestResourceLimitsAccount(cloudstackTestCase):
         #    create Volume without any warning
 
         self.debug(
-            "Updating volume resource limit for account: %s" % 
+            "Updating volume resource limit for account: %s" %
                                                 self.account_1.account.name)
         # Set usage_vm=1 for Account 1
         update_resource_limit(
                               self.apiclient,
-                              2, # Volume
+                              2,    # Volume
                               account=self.account_1.account.name,
                               domainid=self.account_1.account.domainid,
                               max=2
@@ -687,7 +689,7 @@ class TestResourceLimitsAccount(cloudstackTestCase):
     def test_05_templates_per_account(self):
         """Test Templates limit per account
         """
-        tags = ["advanced","advancedns"]
+        tags = ["advanced", "advancedns"]
 
         # Validate the following
         # 1. Set templates=1 limit for account 1.
@@ -697,19 +699,19 @@ class TestResourceLimitsAccount(cloudstackTestCase):
         #    able to create template without any error
 
         self.debug(
-            "Updating template resource limit for account: %s" % 
+            "Updating template resource limit for account: %s" %
                                                 self.account_1.account.name)
         # Set usage_vm=1 for Account 1
         update_resource_limit(
                               self.apiclient,
-                              4, # Template
+                              4,    # Template
                               account=self.account_1.account.name,
                               domainid=self.account_1.account.domainid,
                               max=1
                               )
 
         self.debug(
-            "Updating volume resource limit for account: %s" % 
+            "Updating volume resource limit for account: %s" %
                                                 self.account_1.account.name)
         virtual_machine_1 = VirtualMachine.create(
                                 self.apiclient,
@@ -728,7 +730,7 @@ class TestResourceLimitsAccount(cloudstackTestCase):
                         )
 
         self.debug(
-            "Deploying virtual machine for account: %s" % 
+            "Deploying virtual machine for account: %s" %
                                                 self.account_2.account.name)
         # Create VM for second account
         virtual_machine_2 = VirtualMachine.create(
@@ -917,7 +919,7 @@ class TestResourceLimitsDomain(cloudstackTestCase):
     def test_01_vm_per_domain(self):
         """Test VM limit per domain
         """
-        tags = ["advanced","advancedns"]
+        tags = ["advanced", "advancedns"]
 
         # Validate the following
         # 1. Set max VM per domain to 2
@@ -926,12 +928,12 @@ class TestResourceLimitsDomain(cloudstackTestCase):
         #    should be raised
 
         self.debug(
-            "Updating instance resource limits for domain: %s" % 
+            "Updating instance resource limits for domain: %s" %
                                         self.account.account.domainid)
         # Set usage_vm=1 for Account 1
         update_resource_limit(
                               self.apiclient,
-                              0, # Instance
+                              0,    # Instance
                               domainid=self.account.account.domainid,
                               max=2
                               )
@@ -983,7 +985,7 @@ class TestResourceLimitsDomain(cloudstackTestCase):
     def test_01_publicip_per_domain(self):
         """Test Public IP limit per domain
         """
-        tags = ["advanced","advancedns"]
+        tags = ["advanced", "advancedns"]
 
         # Validate the following
         # 1. set max no of IPs per domain to 2.
@@ -994,12 +996,12 @@ class TestResourceLimitsDomain(cloudstackTestCase):
         #    appropriate error and an alert should be generated.
 
         self.debug(
-            "Updating public IP resource limits for domain: %s" % 
+            "Updating public IP resource limits for domain: %s" %
                                         self.account.account.domainid)
         # Set usage_vm=1 for Account 1
         update_resource_limit(
                               self.apiclient,
-                              1, # Public Ip
+                              1,    # Public Ip
                               domainid=self.account.account.domainid,
                               max=2
                               )
@@ -1053,7 +1055,7 @@ class TestResourceLimitsDomain(cloudstackTestCase):
     def test_03_snapshots_per_domain(self):
         """Test Snapshot limit per domain
         """
-        tags = ["advanced","advancedns"]
+        tags = ["advanced", "advancedns"]
 
         # Validate the following
         # 1. set max no of snapshots per domain to 1.
@@ -1065,12 +1067,12 @@ class TestResourceLimitsDomain(cloudstackTestCase):
         #    user an appropriate error and an alert should be generated.
 
         self.debug(
-            "Updating snapshot resource limits for domain: %s" % 
+            "Updating snapshot resource limits for domain: %s" %
                                         self.account.account.domainid)
         # Set usage_vm=1 for Account 1
         update_resource_limit(
                               self.apiclient,
-                              3, # Snapshot
+                              3,    # Snapshot
                               domainid=self.account.account.domainid,
                               max=1
                               )
@@ -1136,7 +1138,7 @@ class TestResourceLimitsDomain(cloudstackTestCase):
     def test_04_volumes_per_domain(self):
         """Test Volumes limit per domain
         """
-        tags = ["advanced","advancedns"]
+        tags = ["advanced", "advancedns"]
 
         # Validate the following
         # 1. set max no of volume per domain to 1.
@@ -1147,12 +1149,12 @@ class TestResourceLimitsDomain(cloudstackTestCase):
         #    should be generated.
 
         self.debug(
-            "Updating volume resource limits for domain: %s" % 
+            "Updating volume resource limits for domain: %s" %
                                         self.account.account.domainid)
         # Set usage_vm=1 for Account 1
         update_resource_limit(
                               self.apiclient,
-                              2, # Volume
+                              2,    # Volume
                               domainid=self.account.account.domainid,
                               max=2
                               )
@@ -1189,9 +1191,9 @@ class TestResourceLimitsDomain(cloudstackTestCase):
     def test_05_templates_per_domain(self):
         """Test Templates limit per domain
         """
-        tags = ["advanced","advancedns"]
+        tags = ["advanced", "advancedns"]
 
-        # Validate the following 
+        # Validate the following
         # 1. set max no of templates per domain to 2.
         # 2. Create an account in this domain
         # 3. Create 2 templates in this domain. Both template should be in
@@ -1202,18 +1204,18 @@ class TestResourceLimitsDomain(cloudstackTestCase):
         # Set usage_vm=1 for Account 1
         update_resource_limit(
                               self.apiclient,
-                              2, # Volume
+                              2,    # Volume
                               domainid=self.account.account.domainid,
                               max=5
                               )
 
         self.debug(
-            "Updating template resource limits for domain: %s" % 
+            "Updating template resource limits for domain: %s" %
                                         self.account.account.domainid)
         # Set usage_vm=1 for Account 1
         update_resource_limit(
                               self.apiclient,
-                              4, # Template
+                              4,    # Template
                               domainid=self.account.account.domainid,
                               max=2
                               )
@@ -1301,14 +1303,14 @@ class TestResources(cloudstackTestCase):
     @classmethod
     def setUpClass(cls):
         cls.api_client = super(
-                               TestResources, 
+                               TestResources,
                                cls
                                ).getClsTestClient().getApiClient()
         cls.services = Services().services
         # Get Zone, Domain and templates
         cls.zone = get_zone(cls.api_client, cls.services)
         cls._cleanup = []
-	return
+    return
 
     @classmethod
     def tearDownClass(cls):
@@ -1335,16 +1337,16 @@ class TestResources(cloudstackTestCase):
 
     def test_01_zones(self):
         """Check the status of zones"""
-        tags = ["advanced","advancedns"]
-        
+        tags = ["advanced", "advancedns"]
+
         # Validate the following
         # 1. List zones
         # 2. Check allocation state is "enabled" or not
-        
+
         zones = Zone.list(
                           self.apiclient,
                           id=self.zone.id,
-			  listall=True
+              listall=True
                           )
         self.assertEqual(
                          isinstance(zones, list),
@@ -1361,16 +1363,16 @@ class TestResources(cloudstackTestCase):
 
     def test_02_pods(self):
         """Check the status of pods"""
-        tags = ["advanced","advancedns"]
-        
+        tags = ["advanced", "advancedns"]
+
         # Validate the following
         # 1. List pods
         # 2. Check allocation state is "enabled" or not
-        
+
         pods = Pod.list(
                           self.apiclient,
                           zoneid=self.zone.id,
-			  listall=True
+              listall=True
                           )
         self.assertEqual(
                          isinstance(pods, list),
@@ -1384,19 +1386,19 @@ class TestResources(cloudstackTestCase):
                              "Pods allocation state should be enabled"
                              )
         return
-    
+
     def test_03_clusters(self):
         """Check the status of clusters"""
-        tags = ["advanced","advancedns"]
-        
+        tags = ["advanced", "advancedns"]
+
         # Validate the following
         # 1. List clusters
         # 2. Check allocation state is "enabled" or not
-        
+
         clusters = Cluster.list(
                           self.apiclient,
                           zoneid=self.zone.id,
-			  listall=True
+              listall=True
                           )
         self.assertEqual(
                          isinstance(clusters, list),
@@ -1410,20 +1412,20 @@ class TestResources(cloudstackTestCase):
                              "Clusters allocation state should be enabled"
                              )
         return
-    
+
     def test_04_hosts(self):
         """Check the status of hosts"""
-        tags = ["advanced","advancedns"]
-        
+        tags = ["advanced", "advancedns"]
+
         # Validate the following
         # 1. List hosts with type=Routing
         # 2. Check state is "Up" or not
-        
+
         hosts = Host.list(
                           self.apiclient,
                           zoneid=self.zone.id,
                           type='Routing',
-			  listall=True
+              listall=True
                           )
         self.assertEqual(
                          isinstance(hosts, list),
@@ -1437,19 +1439,19 @@ class TestResources(cloudstackTestCase):
                              "Host should be in Up state and running"
                              )
         return
-    
+
     def test_05_storage_pools(self):
         """Check the status of Storage pools"""
-        tags = ["advanced","advancedns"]
-        
+        tags = ["advanced", "advancedns"]
+
         # Validate the following
         # 1. List storage pools for the zone
         # 2. Check state is "enabled" or not
-        
+
         storage_pools = StoragePool.list(
                           self.apiclient,
                           zoneid=self.zone.id,
-			  listall=True
+              listall=True
                           )
         self.assertEqual(
                          isinstance(storage_pools, list),
@@ -1463,20 +1465,20 @@ class TestResources(cloudstackTestCase):
                              "storage pool should be in Up state and running"
                              )
         return
-    
+
     def test_06_secondary_storage(self):
         """Check the status of secondary storage"""
-        tags = ["advanced","advancedns"]
-        
+        tags = ["advanced", "advancedns"]
+
         # Validate the following
         # 1. List secondary storage
         # 2. Check state is "Up" or not
-        
+
         sec_storages = Host.list(
                           self.apiclient,
                           zoneid=self.zone.id,
                           type='SecondaryStorage',
-			  listall=True
+              listall=True
                           )
         self.assertEqual(
                          isinstance(sec_storages, list),

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/b433b1af/test/integration/component/test_routers.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_routers.py b/test/integration/component/test_routers.py
index b6ff307..f826001 100644
--- a/test/integration/component/test_routers.py
+++ b/test/integration/component/test_routers.py
@@ -82,7 +82,7 @@ class Services:
                                     "publicport": 2222,
                                     "protocol": 'TCP',
                                 },
-                         "fw_rule":{
+                         "fw_rule": {
                                     "startport": 1,
                                     "endport": 6000,
                                     "cidr": '55.55.0.0/11',
@@ -90,7 +90,7 @@ class Services:
                                     },
                          "ostypeid": '5776c0d2-f331-42db-ba3a-29f1f8319bc9',
                          # Used for Get_Template : CentOS 5.3 (64 bit)
-                         "mode": 'advanced', # Networking mode: Advanced, basic
+                         "mode": 'advanced',    # Networking mode: Advanced, basic
                         }
 
 
@@ -180,7 +180,7 @@ class TestRouterServices(cloudstackTestCase):
         #    e. LB
         #    f. VPN
         #    g. userdata
-        # 2. wait for router to start and guest network to be created 
+        # 2. wait for router to start and guest network to be created
         #    a. listRouters account=user, domainid=1 (router state=Running)
         #    b. listNetworks account=user domainid=1 (network state=Implemented)
         #    c. listVirtualMachines account=user domainid=1 (VM state=Running)
@@ -318,7 +318,7 @@ class TestRouterServices(cloudstackTestCase):
         """
         tags = ["advanced"]
         # Validate the following
-        # 1. wait for router to start and guest network to be created 
+        # 1. wait for router to start and guest network to be created
         #    a.listRouters account=user, domainid=1 (router state=Running)
         #    b.listNetworks account=user domainid=1 (network state=Implemented)
         #    c.listVirtualMachines account=user domainid=1 (VM states=Running)
@@ -436,9 +436,9 @@ class TestRouterServices(cloudstackTestCase):
                         )
         self.debug("network.gc.wait: %s" % gcwait[0].value)
 
-	total_wait = int(gcinterval[0].value) + int (gcwait[0].value)
+        total_wait = int(gcinterval[0].value) + int(gcwait[0].value)
         # Router is stopped after (network.gc.interval *2) time. Wait for
-        # (network.gc.interval+network.gc.wait) * 2 for moving router to 'Stopped' 
+        # (network.gc.interval+network.gc.wait) * 2 for moving router to 'Stopped'
         time.sleep(total_wait * 2)
 
         routers = list_routers(
@@ -580,7 +580,6 @@ class TestRouterServices(cloudstackTestCase):
         return
 
 
-
 class TestRouterStopCreatePF(cloudstackTestCase):
 
     @classmethod
@@ -657,10 +656,10 @@ class TestRouterStopCreatePF(cloudstackTestCase):
         # 2. stopRouter for this account
         # 3. wait for listRouters to report Router as 'Stopped'
         # 4. listPublicIpAddresses account=user, domainid=1 - pick ipaddressid
-        # 5. createPortForwardingRule (ipaddressid from step 5.) 
+        # 5. createPortForwardingRule (ipaddressid from step 5.)
         #    a. for port 22 (ssh) for user VM deployed in step 1.
         #    b. public port 222 , private port 22
-        # 6. startRouter stopped for this account 
+        # 6. startRouter stopped for this account
         # 7. wait for listRouters to show router as Running
 
         # Get router details associated for that account
@@ -720,7 +719,7 @@ class TestRouterStopCreatePF(cloudstackTestCase):
                         )
         public_ip = public_ips[0]
 
-        # Open up firewall port for SSH        
+        # Open up firewall port for SSH
         fw_rule = FireWallRule.create(
                             self.apiclient,
                             ipaddressid=public_ip.id,
@@ -791,6 +790,7 @@ class TestRouterStopCreatePF(cloudstackTestCase):
                       )
         return
 
+
 class TestRouterStopCreateLB(cloudstackTestCase):
 
     @classmethod
@@ -923,8 +923,8 @@ class TestRouterStopCreateLB(cloudstackTestCase):
                         "Check for list public IPs response return valid data"
                         )
         public_ip = public_ips[0]
-        
-        # Open up firewall port for SSH        
+
+        # Open up firewall port for SSH
         fw_rule = FireWallRule.create(
                             self.apiclient,
                             ipaddressid=public_ip.id,
@@ -1076,7 +1076,7 @@ class TestRouterStopCreateFW(cloudstackTestCase):
         #    (optional backend)
         # 3. verify on router using iptables -t nat -nvx if rules are applied
 
-        # Get the router details associated with account 
+        # Get the router details associated with account
         routers = list_routers(
                                self.apiclient,
                                account=self.account.account.name,
@@ -1223,4 +1223,3 @@ class TestRouterStopCreateFW(cloudstackTestCase):
                             "Check public IP address"
                         )
         return
-