mirror of
https://github.com/saltstack/salt.git
synced 2025-04-16 09:40:20 +00:00
remove impacket usage from saltify
This commit is contained in:
parent
b001bacedc
commit
320de9bd04
1 changed files with 6 additions and 7 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue