From 6953134a1348e6cfce3166262ed5f4768ef37cf9 Mon Sep 17 00:00:00 2001 From: Jianghua Wang Date: Sun, 8 Apr 2018 09:21:55 +0000 Subject: [PATCH] Avoid using the module of future in xapi plugin In XenServer's dom0 (e.g. XS7.0/7.1), the module of future is not available. So this commit is to avoid using *future*. Instead it import check_output from different modules basing if *future* module is available of not. Change-Id: Ib75b2b7965e63033ea933f7cb4a4a54a2f48ef75 Partial-Bug: #1762130 --- os_xenapi/dom0/etc/xapi.d/plugins/agent.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/os_xenapi/dom0/etc/xapi.d/plugins/agent.py b/os_xenapi/dom0/etc/xapi.d/plugins/agent.py index a763d09..f079a10 100644 --- a/os_xenapi/dom0/etc/xapi.d/plugins/agent.py +++ b/os_xenapi/dom0/etc/xapi.d/plugins/agent.py @@ -30,9 +30,10 @@ # import base64 -from future import standard_library -standard_library.install_aliases() -from subprocess import getoutput +try: + from subprocess import getoutput +except ImportError: + from commands import getoutput # noqa try: import json except ImportError: