Remove backslash to meet PEP8 requirement
authorhelenyao <yaohelan@huawei.com>
Tue, 20 Dec 2016 03:18:33 +0000 (22:18 -0500)
committerhelenyao <yaohelan@huawei.com>
Tue, 20 Dec 2016 12:34:48 +0000 (07:34 -0500)
JIRA: FUNCTEST-630

Change-Id: Ia02760fd98aaab59a6cf0a90a2020b76e0c92df6
Signed-off-by: helenyao <yaohelan@huawei.com>
functest/core/pytest_suite_runner.py [changed mode: 0644->0755]
functest/opnfv_tests/openstack/examples/create_instance_and_ip.py
functest/opnfv_tests/openstack/vping/vping_base.py [changed mode: 0644->0755]
functest/opnfv_tests/openstack/vping/vping_ssh.py

old mode 100644 (file)
new mode 100755 (executable)
index 2d5b266..1eed92b
@@ -41,8 +41,8 @@ class PyTestSuiteRunner(base.TestcaseBase):
             for test, message in result.failures:
                 self.logger.error(str(test) + " FAILED with " + message)
 
-        if (result.errors and len(result.errors) > 0) \
-                or (result.failures and len(result.failures) > 0):
+        if ((result.errors and len(result.errors) > 0)
+                or (result.failures and len(result.failures) > 0)):
             self.logger.info("%s FAILED" % self.case_name)
             self.criteria = 'FAIL'
             exit_code = base.TestcaseBase.EX_RUN_ERROR
index b4e2e51..4a9ff71 100755 (executable)
@@ -64,11 +64,12 @@ def main():
                                             container="bare",
                                             public=True)
 
-    network_dic = os_utils.create_network_full(neutron_client,
-                                               EXAMPLE_PRIVATE_NET_NAME,
-                                               EXAMPLE_PRIVATE_SUBNET_NAME,
-                                               EXAMPLE_ROUTER_NAME,
-                                               EXAMPLE_PRIVATE_SUBNET_CIDR)
+    network_dic = os_utils.create_network_full(
+                    neutron_client,
+                    EXAMPLE_PRIVATE_NET_NAME,
+                    EXAMPLE_PRIVATE_SUBNET_NAME,
+                    EXAMPLE_ROUTER_NAME,
+                    EXAMPLE_PRIVATE_SUBNET_CIDR)
     if not network_dic:
         logger.error(
             "There has been a problem when creating the neutron network")
@@ -86,11 +87,11 @@ def main():
         "Configuration:\n name=%s \n flavor=%s \n image=%s \n "
         "network=%s \n"
         % (EXAMPLE_INSTANCE_NAME, EXAMPLE_FLAVOR, image_id, network_id))
-    instance = \
-        os_utils.create_instance_and_wait_for_active(EXAMPLE_FLAVOR,
-                                                     image_id,
-                                                     network_id,
-                                                     EXAMPLE_INSTANCE_NAME)
+    instance = os_utils.create_instance_and_wait_for_active(
+                EXAMPLE_FLAVOR,
+                image_id,
+                network_id,
+                EXAMPLE_INSTANCE_NAME)
 
     if instance is None:
         logger.error("Error while booting instance.")
old mode 100644 (file)
new mode 100755 (executable)
index 213b79f..e467dd9
@@ -36,9 +36,9 @@ class VPingBase(testcase_base.TestcaseBase):
         self.image_name = get_conf('vping.image_name')
         self.image_filename = get_conf('general.openstack.image_file_name')
         self.image_format = get_conf('general.openstack.image_disk_format')
-        self.image_path = \
-            "%s/%s" % (get_conf('general.directories.dir_functest_data'),
-                       self.image_filename)
+        self.image_path = ("%s/%s" %
+                           (get_conf('general.directories.dir_functest_data'),
+                            self.image_filename))
 
         self.flavor_name = get_conf('vping.vm_flavor')
 
index 8ae590e..b032c30 100755 (executable)
@@ -101,9 +101,9 @@ class VPingSSH(vping_base.VPingBase):
                                   "from the dhcp agent." % self.vm2_name)
 
             # if dhcp not work,it shows "No lease, failing".The test will fail
-            if "No lease, failing" in console_log \
-                    and not nolease \
-                    and not got_ip:
+            if ("No lease, failing" in console_log and
+                not nolease and
+                    not got_ip):
                 nolease = True
                 self.logger.debug("Console-log '%s': No lease, failing..."
                                   % self.vm2_name)