Fix pylint warnings in snaps
authorCédric Ollivier <cedric.ollivier@orange.com>
Sun, 30 Apr 2017 07:35:05 +0000 (09:35 +0200)
committerCédric Ollivier <cedric.ollivier@orange.com>
Sun, 30 Apr 2017 07:35:05 +0000 (09:35 +0200)
Pylint only warns about missing module docstrings now.

Change-Id: I989ff800cd2628fed80a2d3510ef37ce2876cbd4
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
functest/opnfv_tests/openstack/snaps/health_check.py
functest/opnfv_tests/openstack/snaps/smoke.py
functest/opnfv_tests/openstack/snaps/snaps_test_runner.py

index 44e3b87..c057eb2 100644 (file)
@@ -30,8 +30,7 @@ class HealthCheck(SnapsTestRunner):
 
         image_custom_config = None
         if hasattr(CONST, 'snaps_health_check'):
-            image_custom_config = CONST.snaps_health_check
-
+            image_custom_config = CONST.__getattribute__('snaps_health_check')
         self.suite.addTest(
             OSIntegrationTestCase.parameterize(
                 SimpleHealthCheck, os_creds=self.os_creds,
index 5a637f2..2c6fc25 100644 (file)
@@ -32,12 +32,13 @@ class SnapsSmoke(SnapsTestRunner):
         # snaps_health_check suite, so reuse it here
         image_custom_config = None
         if hasattr(CONST, 'snaps_health_check'):
-            image_custom_config = CONST.snaps_health_check
+            image_custom_config = CONST.__getattribute__('snaps_health_check')
 
         # Tests requiring floating IPs leverage files contained within the
         # SNAPS repository and are found relative to that path
         if self.use_fip:
-            snaps_dir = CONST.dir_repo_snaps + '/snaps'
+            snaps_dir = os.path.join(CONST.__getattribute__('dir_repo_snaps'),
+                                     'snaps')
             os.chdir(snaps_dir)
 
         test_suite_builder.add_openstack_integration_tests(
index b17aab0..8a68cad 100644 (file)
@@ -24,16 +24,16 @@ class SnapsTestRunner(PyTestSuiteRunner):
         super(SnapsTestRunner, self).__init__(**kwargs)
 
         self.os_creds = openstack_tests.get_credentials(
-            os_env_file=CONST.openstack_creds, proxy_settings_str=None,
-            ssh_proxy_cmd=None)
+            os_env_file=CONST.__getattribute__('openstack_creds'),
+            proxy_settings_str=None, ssh_proxy_cmd=None)
 
         self.ext_net_name = snaps_utils.get_ext_net_name(self.os_creds)
-        self.use_fip = CONST.snaps_use_floating_ips
-        self.use_keystone = CONST.snaps_use_keystone
+        self.use_fip = CONST.__getattribute__('snaps_use_floating_ips')
+        self.use_keystone = CONST.__getattribute__('snaps_use_keystone')
         scenario = functest_utils.get_scenario()
 
         self.flavor_metadata = create_flavor.MEM_PAGE_SIZE_ANY
         if 'ovs' in scenario or 'fdio' in scenario:
             self.flavor_metadata = create_flavor.MEM_PAGE_SIZE_LARGE
 
-        self.logger.info("Using flavor metatdata '%s'" % self.flavor_metadata)
+        self.logger.info("Using flavor metadata '%s'", self.flavor_metadata)