Skip to content

Commit

Permalink
Merge pull request #443 from Priyanka-Middha/v4.1.0
Browse files Browse the repository at this point in the history
NP-7067 | Added V6 networking support in Transport Node module
  • Loading branch information
budipi authored Sep 23, 2022
2 parents 76cc298 + ee98e51 commit 9245e16
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion plugins/modules/nsxt_transport_nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,7 @@
import socket
import hashlib
import ssl
import ipaddress

FAILED_STATES = ["failed"]
IN_PROGRESS_STATES = ["pending", "in_progress"]
Expand Down Expand Up @@ -813,7 +814,11 @@ def check_for_update(module, manager_url, mgr_username, mgr_password, validate_c
return False

def get_api_cert_thumbprint(ip_address, module):
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
ip = ipaddress.ip_address(ip_address)
if isinstance(ip, ipaddress.IPv4Address):
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
elif isinstance(ip, ipaddress.IPv6Address):
sock = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
sock.settimeout(1)
wrappedSocket = ssl.wrap_socket(sock)
try:
Expand Down

0 comments on commit 9245e16

Please sign in to comment.