mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
Update workaround to root of file
This commit is contained in:
parent
253ab11bd9
commit
37ab1f84b8
@ -19,6 +19,14 @@ from __future__ import absolute_import
|
|||||||
import copy
|
import copy
|
||||||
import logging
|
import logging
|
||||||
import re
|
import re
|
||||||
|
try:
|
||||||
|
if globals()['__builtins__'].reload:
|
||||||
|
pass
|
||||||
|
except AttributeError:
|
||||||
|
try:
|
||||||
|
from importlib import reload
|
||||||
|
except ImportError:
|
||||||
|
from imp import reload
|
||||||
|
|
||||||
# Import salt libs
|
# Import salt libs
|
||||||
import salt.utils
|
import salt.utils
|
||||||
@ -61,29 +69,13 @@ def __virtual__():
|
|||||||
|
|
||||||
def _vartree():
|
def _vartree():
|
||||||
import portage # pylint: disable=3rd-party-module-not-gated
|
import portage # pylint: disable=3rd-party-module-not-gated
|
||||||
try:
|
reload(portage)
|
||||||
reload(portage)
|
|
||||||
except NameError:
|
|
||||||
try:
|
|
||||||
from importlib import reload
|
|
||||||
reload(portage)
|
|
||||||
except ImportError:
|
|
||||||
from imp import reload
|
|
||||||
reload(portage)
|
|
||||||
return portage.db[portage.root]['vartree']
|
return portage.db[portage.root]['vartree']
|
||||||
|
|
||||||
|
|
||||||
def _porttree():
|
def _porttree():
|
||||||
import portage # pylint: disable=3rd-party-module-not-gated
|
import portage # pylint: disable=3rd-party-module-not-gated
|
||||||
try:
|
reload(portage)
|
||||||
reload(portage)
|
|
||||||
except NameError:
|
|
||||||
try:
|
|
||||||
from importlib import reload
|
|
||||||
reload(portage)
|
|
||||||
except ImportError:
|
|
||||||
from imp import reload
|
|
||||||
reload(portage)
|
|
||||||
return portage.db[portage.root]['porttree']
|
return portage.db[portage.root]['porttree']
|
||||||
|
|
||||||
|
|
||||||
|
@ -13,6 +13,15 @@ import logging
|
|||||||
import re
|
import re
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
try:
|
||||||
|
if globals()['__builtins__'].reload:
|
||||||
|
pass
|
||||||
|
except AttributeError:
|
||||||
|
try:
|
||||||
|
from importlib import reload
|
||||||
|
except ImportError:
|
||||||
|
from imp import reload
|
||||||
|
|
||||||
# Import salt libs
|
# Import salt libs
|
||||||
from salt.utils.timeout import wait_for
|
from salt.utils.timeout import wait_for
|
||||||
|
|
||||||
@ -132,22 +141,7 @@ def vb_get_manager():
|
|||||||
'''
|
'''
|
||||||
global _virtualboxManager
|
global _virtualboxManager
|
||||||
if _virtualboxManager is None and HAS_LIBS:
|
if _virtualboxManager is None and HAS_LIBS:
|
||||||
try:
|
reload(vboxapi)
|
||||||
from importlib import reload
|
|
||||||
except ImportError:
|
|
||||||
# If we get here, we are in py2 and reload is a built-in.
|
|
||||||
pass
|
|
||||||
|
|
||||||
# Reloading the API extends sys.paths for subprocesses of multiprocessing, since they seem to share contexts
|
|
||||||
try:
|
|
||||||
reload(vboxapi)
|
|
||||||
except NameError:
|
|
||||||
try:
|
|
||||||
from importlib import reload
|
|
||||||
reload(vboxapi)
|
|
||||||
except ImportError:
|
|
||||||
from imp import reload
|
|
||||||
reload(vboxapi)
|
|
||||||
_virtualboxManager = vboxapi.VirtualBoxManager(None, None)
|
_virtualboxManager = vboxapi.VirtualBoxManager(None, None)
|
||||||
|
|
||||||
return _virtualboxManager
|
return _virtualboxManager
|
||||||
|
Loading…
Reference in New Issue
Block a user