From 320de9bd04eb72b6d6beb370dd7a530e429f626e Mon Sep 17 00:00:00 2001 From: Joe Eacott Date: Fri, 7 Oct 2022 10:29:39 -0600 Subject: [PATCH] remove impacket usage from saltify --- salt/cloud/clouds/saltify.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/salt/cloud/clouds/saltify.py b/salt/cloud/clouds/saltify.py index 47ff7f43b025..89082ddbef58 100644 --- a/salt/cloud/clouds/saltify.py +++ b/salt/cloud/clouds/saltify.py @@ -29,12 +29,11 @@ try: # noinspection PyUnresolvedReferences - from impacket.smb3 import SessionError as smb3SessionError - from impacket.smbconnection import SessionError as smbSessionError + from smbprotocol.exceptions import InternalError as smbSessionError - HAS_IMPACKET = True + HAS_SMB = True except ImportError: - HAS_IMPACKET = False + HAS_SMB = False try: # noinspection PyUnresolvedReferences @@ -339,8 +338,8 @@ def _verify(vm_): log.debug("Testing Windows authentication method for %s", vm_["name"]) - if not HAS_IMPACKET: - log.error("Impacket library not found") + if not HAS_SMB: + log.error("smbprotocol library not found") return False # Test Windows connection @@ -359,7 +358,7 @@ def _verify(vm_): log.debug("Testing SMB protocol for %s", vm_["name"]) if __utils__["smb.get_conn"](**kwargs) is False: return False - except (smbSessionError, smb3SessionError) as exc: + except (smbSessionError) as exc: log.error("Exception: %s", exc) return False