multiSSH3 5.44__py3-none-any.whl → 5.45__py3-none-any.whl

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.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: multiSSH3
3
- Version: 5.44
3
+ Version: 5.45
4
4
  Summary: Run commands on multiple hosts via SSH
5
5
  Home-page: https://github.com/yufei-pan/multiSSH3
6
6
  Author: Yufei Pan
@@ -0,0 +1,6 @@
1
+ multiSSH3.py,sha256=2rWmKOIbJ4_iRZnRdghYiCpndZbnpXcqPNsL6HCL8xY,135383
2
+ multiSSH3-5.45.dist-info/METADATA,sha256=MwSMoniNIAsjCvkxg6o3tkePVfYMYZJKxVDvEytPAVs,18001
3
+ multiSSH3-5.45.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
4
+ multiSSH3-5.45.dist-info/entry_points.txt,sha256=xi2rWWNfmHx6gS8Mmx0rZL2KZz6XWBYP3DWBpWAnnZ0,143
5
+ multiSSH3-5.45.dist-info/top_level.txt,sha256=tUwttxlnpLkZorSsroIprNo41lYSxjd2ASuL8-EJIJw,10
6
+ multiSSH3-5.45.dist-info/RECORD,,
multiSSH3.py CHANGED
@@ -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.44'
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
- __host_i_lock = threading.Lock()
161
- __host_i_counter = -1
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
- global __host_i_counter
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 = _get_i(),uuid=uuid.uuid4(),ip = None):
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)
@@ -1,6 +0,0 @@
1
- multiSSH3.py,sha256=bv60tQeVuc9mX2LL20sQbrst_dPEluel6Yg141kYxK8,135462
2
- multiSSH3-5.44.dist-info/METADATA,sha256=1NZdIrRezS68gFKzFM2pcJBW_OCYYdNF87NDQ7nHelY,18001
3
- multiSSH3-5.44.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
4
- multiSSH3-5.44.dist-info/entry_points.txt,sha256=xi2rWWNfmHx6gS8Mmx0rZL2KZz6XWBYP3DWBpWAnnZ0,143
5
- multiSSH3-5.44.dist-info/top_level.txt,sha256=tUwttxlnpLkZorSsroIprNo41lYSxjd2ASuL8-EJIJw,10
6
- multiSSH3-5.44.dist-info/RECORD,,