Skip to content

Commit 6f028ea

Browse files
committed
fix: Fixed rpyc_server on ESXi
On ESXi we cannot import requests, in WinRm it's imported, so moving it out from ESXi fixes #3 Signed-off-by: Lasota, Adrian <adrian.lasota@intel.com>
1 parent 998b5d3 commit 6f028ea

File tree

1 file changed

+16
-20
lines changed

1 file changed

+16
-20
lines changed

mfd_connect/__init__.py

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,26 @@
22
# SPDX-License-Identifier: MIT
33
"""Package for Connection implementations."""
44

5-
import sys
65
import logging
76

87
logger = logging.getLogger(__name__)
98

10-
if "-m" in sys.argv and "mfd_connect.rpyc_server" in sys.argv:
11-
logger.log(logging.DEBUG, "Running as a module - skipping importing in mfd_connect.__init__")
12-
else:
13-
import platform
9+
import platform
1410

15-
from mfd_typing import OSName
11+
from mfd_typing import OSName
1612

17-
from .base import Connection, AsyncConnection, PythonConnection
18-
from .local import LocalConnection
19-
from .rpyc import RPyCConnection
20-
from .tunneled_rpyc import TunneledRPyCConnection
21-
from .sol import SolConnection
22-
from .serial import SerialConnection
23-
from .telnet.telnet import TelnetConnection
24-
from .winrm import WinRmConnection
13+
from .base import Connection, AsyncConnection, PythonConnection
14+
from .local import LocalConnection
15+
from .rpyc import RPyCConnection
16+
from .tunneled_rpyc import TunneledRPyCConnection
17+
from .sol import SolConnection
18+
from .serial import SerialConnection
19+
from .telnet.telnet import TelnetConnection
2520

26-
if platform.system() != OSName.ESXI.value:
27-
from .ssh import SSHConnection
28-
from .interactive_ssh import InteractiveSSHConnection
29-
from .tunneled_ssh import TunneledSSHConnection
30-
from .rpyc_zero_deploy import RPyCZeroDeployConnection
31-
from .pxssh import PxsshConnection
21+
if platform.system() != OSName.ESXI.value:
22+
from .winrm import WinRmConnection
23+
from .ssh import SSHConnection
24+
from .interactive_ssh import InteractiveSSHConnection
25+
from .tunneled_ssh import TunneledSSHConnection
26+
from .rpyc_zero_deploy import RPyCZeroDeployConnection
27+
from .pxssh import PxsshConnection

0 commit comments

Comments
 (0)