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 logging
|
||||
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.utils
|
||||
@ -61,29 +69,13 @@ def __virtual__():
|
||||
|
||||
def _vartree():
|
||||
import portage # pylint: disable=3rd-party-module-not-gated
|
||||
try:
|
||||
reload(portage)
|
||||
except NameError:
|
||||
try:
|
||||
from importlib import reload
|
||||
reload(portage)
|
||||
except ImportError:
|
||||
from imp import reload
|
||||
reload(portage)
|
||||
reload(portage)
|
||||
return portage.db[portage.root]['vartree']
|
||||
|
||||
|
||||
def _porttree():
|
||||
import portage # pylint: disable=3rd-party-module-not-gated
|
||||
try:
|
||||
reload(portage)
|
||||
except NameError:
|
||||
try:
|
||||
from importlib import reload
|
||||
reload(portage)
|
||||
except ImportError:
|
||||
from imp import reload
|
||||
reload(portage)
|
||||
reload(portage)
|
||||
return portage.db[portage.root]['porttree']
|
||||
|
||||
|
||||
|
@ -13,6 +13,15 @@ import logging
|
||||
import re
|
||||
import time
|
||||
|
||||
try:
|
||||
if globals()['__builtins__'].reload:
|
||||
pass
|
||||
except AttributeError:
|
||||
try:
|
||||
from importlib import reload
|
||||
except ImportError:
|
||||
from imp import reload
|
||||
|
||||
# Import salt libs
|
||||
from salt.utils.timeout import wait_for
|
||||
|
||||
@ -132,22 +141,7 @@ def vb_get_manager():
|
||||
'''
|
||||
global _virtualboxManager
|
||||
if _virtualboxManager is None and HAS_LIBS:
|
||||
try:
|
||||
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)
|
||||
reload(vboxapi)
|
||||
_virtualboxManager = vboxapi.VirtualBoxManager(None, None)
|
||||
|
||||
return _virtualboxManager
|
||||
|
Loading…
Reference in New Issue
Block a user