mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 03:11:24 -07:00
Create persistent socket path using port and connection type (#28492)
* Create persistent socket path using port and connection type * Use remote address, port, connection type and remote user to create a socket path. * Fix review comment
This commit is contained in:
parent
9407a17c40
commit
cd8c1c1108
2 changed files with 4 additions and 2 deletions
|
@ -268,9 +268,11 @@ class Connection(ConnectionBase):
|
|||
sock.close()
|
||||
|
||||
@staticmethod
|
||||
def _create_control_path(host, port, user):
|
||||
def _create_control_path(host, port, user, connection=None):
|
||||
'''Make a hash for the controlpath based on con attributes'''
|
||||
pstring = '%s-%s-%s' % (host, port, user)
|
||||
if connection:
|
||||
pstring += '-%s' % connection
|
||||
m = hashlib.sha1()
|
||||
m.update(to_bytes(pstring))
|
||||
digest = m.hexdigest()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue