diff --git a/plugins/xenserver/xenapi/etc/xapi.d/plugins/pluginlib_nova.py b/plugins/xenserver/xenapi/etc/xapi.d/plugins/pluginlib_nova.py index 72d499664642..c8ee755cbe63 100644 --- a/plugins/xenserver/xenapi/etc/xapi.d/plugins/pluginlib_nova.py +++ b/plugins/xenserver/xenapi/etc/xapi.d/plugins/pluginlib_nova.py @@ -135,7 +135,8 @@ def exists(args, key): def optional(args, key): """If the given key is in args, return the corresponding value, otherwise - return None""" + return None + """ return key in args and args[key] or None @@ -207,7 +208,8 @@ def vbd_unplug_with_retry(session, vbd): """Call VBD.unplug on the given VBD, with a retry if we get DEVICE_DETACH_REJECTED. For reasons which I don't understand, we're seeing the device still in use, even when all processes using the device - should be dead.""" + should be dead. + """ while True: try: session.xenapi.VBD.unplug(vbd) @@ -215,7 +217,7 @@ def vbd_unplug_with_retry(session, vbd): return except XenAPI.Failure, e: if (len(e.details) > 0 and - e.details[0] == 'DEVICE_DETACH_REJECTED'): + e.details[0] == 'DEVICE_DETACH_REJECTED'): logging.debug(_('VBD.unplug rejected: retrying...')) time.sleep(1) elif (len(e.details) > 0 and diff --git a/plugins/xenserver/xenapi/etc/xapi.d/plugins/utils.py b/plugins/xenserver/xenapi/etc/xapi.d/plugins/utils.py index ccf1356ab7f8..62dffe248047 100644 --- a/plugins/xenserver/xenapi/etc/xapi.d/plugins/utils.py +++ b/plugins/xenserver/xenapi/etc/xapi.d/plugins/utils.py @@ -103,6 +103,7 @@ def finish_subprocess(proc, cmdline, cmd_input=None, ok_exit_codes=None): raise SubprocessException(' '.join(cmdline), ret, out, err) return out + def run_command(cmd, cmd_input=None, ok_exit_codes=None): """Abstracts out the basics of issuing system commands. If the command returns anything in stderr, an exception is raised with that information. diff --git a/plugins/xenserver/xenapi/etc/xapi.d/plugins/xenstore.py b/plugins/xenserver/xenapi/etc/xapi.d/plugins/xenstore.py index d7eadfe23392..05e3045abbc5 100755 --- a/plugins/xenserver/xenapi/etc/xapi.d/plugins/xenstore.py +++ b/plugins/xenserver/xenapi/etc/xapi.d/plugins/xenstore.py @@ -64,7 +64,8 @@ def jsonify(fnc): def _record_exists(arg_dict): """Returns whether or not the given record exists. The record path - is determined from the given path and dom_id in the arg_dict.""" + is determined from the given path and dom_id in the arg_dict. + """ cmd = ["xenstore-exists", "/local/domain/%(dom_id)s/%(path)s" % arg_dict] try: _run_command(cmd) diff --git a/tox.ini b/tox.ini index 09aff00a7dc0..9d2df7deebdc 100644 --- a/tox.ini +++ b/tox.ini @@ -51,7 +51,7 @@ commands = {posargs} # H102 Apache 2.0 license header not found ignore = E121,E122,E123,E124,E126,E127,E128,E711,E712,H102,H404,F403,F811,F841,H803 -exclude = .venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,*plugins/xenserver*,tools +exclude = .venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,tools [hacking] local-check-factory = nova.hacking.checks.factory