remove impacket usage from saltify

This commit is contained in:
Joe Eacott 2022-10-07 10:29:39 -06:00 committed by Megan Wilhite
parent b001bacedc
commit 320de9bd04

View file

@ -29,12 +29,11 @@ log = logging.getLogger(__name__)
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