multiSSH3 5.44__tar.gz → 5.45__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of multiSSH3 might be problematic. Click here for more details.
- {multissh3-5.44 → multissh3-5.45}/PKG-INFO +1 -1
- {multissh3-5.44 → multissh3-5.45}/multiSSH3.egg-info/PKG-INFO +1 -1
- {multissh3-5.44 → multissh3-5.45}/multiSSH3.py +7 -10
- {multissh3-5.44 → multissh3-5.45}/README.md +0 -0
- {multissh3-5.44 → multissh3-5.45}/multiSSH3.egg-info/SOURCES.txt +0 -0
- {multissh3-5.44 → multissh3-5.45}/multiSSH3.egg-info/dependency_links.txt +0 -0
- {multissh3-5.44 → multissh3-5.45}/multiSSH3.egg-info/entry_points.txt +0 -0
- {multissh3-5.44 → multissh3-5.45}/multiSSH3.egg-info/requires.txt +0 -0
- {multissh3-5.44 → multissh3-5.45}/multiSSH3.egg-info/top_level.txt +0 -0
- {multissh3-5.44 → multissh3-5.45}/setup.cfg +0 -0
- {multissh3-5.44 → multissh3-5.45}/setup.py +0 -0
|
@@ -33,6 +33,7 @@ import getpass
|
|
|
33
33
|
import uuid
|
|
34
34
|
import tempfile
|
|
35
35
|
import math
|
|
36
|
+
from itertools import count
|
|
36
37
|
|
|
37
38
|
try:
|
|
38
39
|
# Check if functiools.cache is available
|
|
@@ -45,7 +46,7 @@ except AttributeError:
|
|
|
45
46
|
# If neither is available, use a dummy decorator
|
|
46
47
|
def cache_decorator(func):
|
|
47
48
|
return func
|
|
48
|
-
version = '5.
|
|
49
|
+
version = '5.45'
|
|
49
50
|
VERSION = version
|
|
50
51
|
|
|
51
52
|
CONFIG_FILE_CHAIN = ['./multiSSH3.config.json',
|
|
@@ -157,8 +158,8 @@ def getIP(hostname: str,local=False):
|
|
|
157
158
|
except:
|
|
158
159
|
return None
|
|
159
160
|
|
|
160
|
-
|
|
161
|
-
|
|
161
|
+
|
|
162
|
+
_i_counter = count()
|
|
162
163
|
def _get_i():
|
|
163
164
|
'''
|
|
164
165
|
Get the global counter for the host objects
|
|
@@ -166,15 +167,11 @@ def _get_i():
|
|
|
166
167
|
Returns:
|
|
167
168
|
int: The global counter for the host objects
|
|
168
169
|
'''
|
|
169
|
-
|
|
170
|
-
global __host_i_lock
|
|
171
|
-
with __host_i_lock:
|
|
172
|
-
__host_i_counter += 1
|
|
173
|
-
return __host_i_counter
|
|
170
|
+
return next(_i_counter)
|
|
174
171
|
|
|
175
172
|
# ------------ Host Object ----------------
|
|
176
173
|
class Host:
|
|
177
|
-
def __init__(self, name, command, files = None,ipmi = False,interface_ip_prefix = None,scp=False,extraargs=None,gatherMode=False,identity_file=None,shell=False,i =
|
|
174
|
+
def __init__(self, name, command, files = None,ipmi = False,interface_ip_prefix = None,scp=False,extraargs=None,gatherMode=False,identity_file=None,shell=False,i = -1,uuid=uuid.uuid4(),ip = None):
|
|
178
175
|
self.name = name # the name of the host (hostname or IP address)
|
|
179
176
|
self.command = command # the command to run on the host
|
|
180
177
|
self.returncode = None # the return code of the command
|
|
@@ -193,7 +190,7 @@ class Host:
|
|
|
193
190
|
self.extraargs = extraargs # extra arguments to be passed to ssh
|
|
194
191
|
self.resolvedName = None # the resolved IP address of the host
|
|
195
192
|
# also store a globally unique integer i from 0
|
|
196
|
-
self.i = i
|
|
193
|
+
self.i = i if i != -1 else _get_i()
|
|
197
194
|
self.uuid = uuid
|
|
198
195
|
self.identity_file = identity_file
|
|
199
196
|
self.ip = ip if ip else getIP(name)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|