Skip to content

Commit

Permalink
remove impacket usage from saltify
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe Eacott authored and Megan Wilhite committed Oct 10, 2022
1 parent b001bac commit 320de9b
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions salt/cloud/clouds/saltify.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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

Expand Down

0 comments on commit 320de9b

Please sign in to comment.