From e8f3525cd335311f87898a8406a26944c4c4b1d0 Mon Sep 17 00:00:00 2001 From: jacky06 Date: Wed, 6 Mar 2019 22:20:37 +0800 Subject: [PATCH] Update hacking version Use latest release 1.1.0 and compatible changes w.r.t pep8 Change-Id: I682333b289738848694636ca994dba005e9690cf --- os_xenapi/dom0/etc/xapi.d/plugins/agent.py | 2 +- os_xenapi/dom0/etc/xapi.d/plugins/netwrap.py | 4 ++-- os_xenapi/tests/plugins/test_dom0_pluginlib.py | 4 ++-- os_xenapi/tests/plugins/test_xenhost.py | 8 ++++---- test-requirements.txt | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/os_xenapi/dom0/etc/xapi.d/plugins/agent.py b/os_xenapi/dom0/etc/xapi.d/plugins/agent.py index f079a10..5023720 100644 --- a/os_xenapi/dom0/etc/xapi.d/plugins/agent.py +++ b/os_xenapi/dom0/etc/xapi.d/plugins/agent.py @@ -44,7 +44,7 @@ import XenAPIPlugin import dom0_pluginlib dom0_pluginlib.configure_logging("agent") -import xenstore +import xenstore # noqa DEFAULT_TIMEOUT = 30 diff --git a/os_xenapi/dom0/etc/xapi.d/plugins/netwrap.py b/os_xenapi/dom0/etc/xapi.d/plugins/netwrap.py index 616637e..73ba23a 100644 --- a/os_xenapi/dom0/etc/xapi.d/plugins/netwrap.py +++ b/os_xenapi/dom0/etc/xapi.d/plugins/netwrap.py @@ -27,9 +27,9 @@ try: import json except ImportError: import simplejson as json -import subprocess +import subprocess # noqa -import XenAPIPlugin +import XenAPIPlugin # noqa ALLOWED_CMDS = [ diff --git a/os_xenapi/tests/plugins/test_dom0_pluginlib.py b/os_xenapi/tests/plugins/test_dom0_pluginlib.py index 589ff83..1ea5e0e 100644 --- a/os_xenapi/tests/plugins/test_dom0_pluginlib.py +++ b/os_xenapi/tests/plugins/test_dom0_pluginlib.py @@ -188,8 +188,8 @@ class PluginlibDom0(plugin_test.PluginTestBase): @mock.patch.object(time, 'sleep') def test_vbd_unplug_with_retry_exceed_max_attempts(self, mock_sleep): - side_effects = ([FakeUnplugException(['DEVICE_DETACH_REJECTED'])] - * (self.dom0_pluginlib.MAX_VBD_UNPLUG_RETRIES + 1)) + side_effects = ([FakeUnplugException(['DEVICE_DETACH_REJECTED'])] * + (self.dom0_pluginlib.MAX_VBD_UNPLUG_RETRIES + 1)) self.session.xenapi.VBD.unplug.side_effect = side_effects self.dom0_pluginlib.XenAPI.Failure = FakeUnplugException diff --git a/os_xenapi/tests/plugins/test_xenhost.py b/os_xenapi/tests/plugins/test_xenhost.py index 0cc35bb..8b51aac 100644 --- a/os_xenapi/tests/plugins/test_xenhost.py +++ b/os_xenapi/tests/plugins/test_xenhost.py @@ -127,8 +127,8 @@ class VMOperationTestCase(plugin_test.PluginTestBase): fake_compute_ref = -1 side_effect_xenapi_failure = FakeXenAPIException side_effect_plugin_error = ( - [self.pluginlib.PluginError] - * self.host.DEFAULT_TRIES) + [self.pluginlib.PluginError] * + self.host.DEFAULT_TRIES) self.mock_patch_object(self.session.xenapi.VM, 'start') self.session.xenapi.VM.start.side_effect = \ @@ -967,8 +967,8 @@ class XenHostTestCase(plugin_test.PluginTestBase): self.host.get_pci_type('fake_session', fake_pci_device) self.host._run_command.assert_called_with( - ["ls", "/sys/bus/pci/devices/" + '0000:' - + fake_pci_device + "/"]) + ["ls", "/sys/bus/pci/devices/" + '0000:' + + fake_pci_device + "/"]) def test_get_pci_type_physfn(self): fake_pci_device = '0000:00:00.0' diff --git a/test-requirements.txt b/test-requirements.txt index fad9b7f..419388f 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -2,7 +2,7 @@ # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. -hacking<0.12,>=0.11.0 # Apache-2.0 +hacking>=1.1.0,<1.2.0 # Apache-2.0 coverage!=4.4,>=4.0 # Apache-2.0 python-subunit>=1.0.0 # Apache-2.0/BSD