Update hacking version

Use latest release 1.1.0 and compatible changes w.r.t pep8

Change-Id: I682333b289738848694636ca994dba005e9690cf
This commit is contained in:
jacky06 2019-03-06 22:20:37 +08:00
parent a2377ac834
commit e8f3525cd3
5 changed files with 10 additions and 10 deletions

View File

@ -44,7 +44,7 @@ import XenAPIPlugin
import dom0_pluginlib import dom0_pluginlib
dom0_pluginlib.configure_logging("agent") dom0_pluginlib.configure_logging("agent")
import xenstore import xenstore # noqa
DEFAULT_TIMEOUT = 30 DEFAULT_TIMEOUT = 30

View File

@ -27,9 +27,9 @@ try:
import json import json
except ImportError: except ImportError:
import simplejson as json import simplejson as json
import subprocess import subprocess # noqa
import XenAPIPlugin import XenAPIPlugin # noqa
ALLOWED_CMDS = [ ALLOWED_CMDS = [

View File

@ -188,8 +188,8 @@ class PluginlibDom0(plugin_test.PluginTestBase):
@mock.patch.object(time, 'sleep') @mock.patch.object(time, 'sleep')
def test_vbd_unplug_with_retry_exceed_max_attempts(self, mock_sleep): def test_vbd_unplug_with_retry_exceed_max_attempts(self, mock_sleep):
side_effects = ([FakeUnplugException(['DEVICE_DETACH_REJECTED'])] side_effects = ([FakeUnplugException(['DEVICE_DETACH_REJECTED'])] *
* (self.dom0_pluginlib.MAX_VBD_UNPLUG_RETRIES + 1)) (self.dom0_pluginlib.MAX_VBD_UNPLUG_RETRIES + 1))
self.session.xenapi.VBD.unplug.side_effect = side_effects self.session.xenapi.VBD.unplug.side_effect = side_effects
self.dom0_pluginlib.XenAPI.Failure = FakeUnplugException self.dom0_pluginlib.XenAPI.Failure = FakeUnplugException

View File

@ -127,8 +127,8 @@ class VMOperationTestCase(plugin_test.PluginTestBase):
fake_compute_ref = -1 fake_compute_ref = -1
side_effect_xenapi_failure = FakeXenAPIException side_effect_xenapi_failure = FakeXenAPIException
side_effect_plugin_error = ( side_effect_plugin_error = (
[self.pluginlib.PluginError] [self.pluginlib.PluginError] *
* self.host.DEFAULT_TRIES) self.host.DEFAULT_TRIES)
self.mock_patch_object(self.session.xenapi.VM, self.mock_patch_object(self.session.xenapi.VM,
'start') 'start')
self.session.xenapi.VM.start.side_effect = \ 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.get_pci_type('fake_session', fake_pci_device)
self.host._run_command.assert_called_with( self.host._run_command.assert_called_with(
["ls", "/sys/bus/pci/devices/" + '0000:' ["ls", "/sys/bus/pci/devices/" + '0000:' +
+ fake_pci_device + "/"]) fake_pci_device + "/"])
def test_get_pci_type_physfn(self): def test_get_pci_type_physfn(self):
fake_pci_device = '0000:00:00.0' fake_pci_device = '0000:00:00.0'

View File

@ -2,7 +2,7 @@
# of appearance. Changing the order has an impact on the overall integration # of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later. # 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 coverage!=4.4,>=4.0 # Apache-2.0
python-subunit>=1.0.0 # Apache-2.0/BSD python-subunit>=1.0.0 # Apache-2.0/BSD