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
This commit is contained in:
Jianghua Wang 2018-04-08 09:21:55 +00:00
parent 3e3b38e74a
commit 6953134a13
1 changed files with 4 additions and 3 deletions

View File

@ -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: