multiSSH3 5.82__tar.gz → 5.83__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.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: multiSSH3
3
- Version: 5.82
3
+ Version: 5.83
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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: multiSSH3
3
- Version: 5.82
3
+ Version: 5.83
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
@@ -55,10 +55,10 @@ except AttributeError:
55
55
  # If neither is available, use a dummy decorator
56
56
  def cache_decorator(func):
57
57
  return func
58
- version = '5.82'
58
+ version = '5.83'
59
59
  VERSION = version
60
60
  __version__ = version
61
- COMMIT_DATE = '2025-07-16'
61
+ COMMIT_DATE = '2025-07-21'
62
62
 
63
63
  CONFIG_FILE_CHAIN = ['./multiSSH3.config.json',
64
64
  '~/multiSSH3.config.json',
@@ -2422,49 +2422,49 @@ def processRunOnHosts(timeout, password, max_connections, hosts, returnUnfinishe
2422
2422
  sleep_interval *= 1.1
2423
2423
  for thread in threads:
2424
2424
  thread.join(timeout=3)
2425
- # update the unavailable hosts and global unavailable hosts
2426
- if willUpdateUnreachableHosts:
2427
- availableHosts = set()
2428
- for host in hosts:
2429
- if host.stderr and ('No route to host' in host.stderr[0].strip() or 'Connection timed out' in host.stderr[0].strip() or (host.stderr[-1].strip().startswith('Timeout!') and host.returncode == 124)):
2430
- unavailableHosts[host.name] = int(time.monotonic())
2431
- __globalUnavailableHosts[host.name] = int(time.monotonic())
2432
- else:
2433
- availableHosts.add(host.name)
2434
- if host.name in unavailableHosts:
2435
- del unavailableHosts[host.name]
2436
- if host.name in __globalUnavailableHosts:
2437
- del __globalUnavailableHosts[host.name]
2438
- if __DEBUG_MODE:
2439
- print(f'Unreachable hosts: {unavailableHosts}')
2440
- try:
2441
- # check for the old content, only update if the new content is different
2442
- if not os.path.exists(os.path.join(tempfile.gettempdir(),f'__{getpass.getuser()}_multiSSH3_UNAVAILABLE_HOSTS.csv')):
2443
- with open(os.path.join(tempfile.gettempdir(),f'__{getpass.getuser()}_multiSSH3_UNAVAILABLE_HOSTS.csv'),'w') as f:
2444
- f.writelines(f'{host},{expTime}' for host,expTime in unavailableHosts.items())
2445
- else:
2446
- oldDic = {}
2447
- try:
2448
- with open(os.path.join(tempfile.gettempdir(),f'__{getpass.getuser()}_multiSSH3_UNAVAILABLE_HOSTS.csv'),'r') as f:
2449
- for line in f:
2450
- line = line.strip()
2451
- if line and ',' in line and len(line.split(',')) >= 2 and line.split(',')[0] and line.split(',')[1].isdigit():
2452
- hostname = line.split(',')[0]
2453
- expireTime = int(line.split(',')[1])
2454
- if expireTime < time.monotonic() and hostname not in availableHosts:
2455
- oldDic[hostname] = expireTime
2456
- except:
2457
- pass
2458
- # add new entries
2459
- oldDic.update(unavailableHosts)
2460
- with open(os.path.join(tempfile.gettempdir(),getpass.getuser()+'__multiSSH3_UNAVAILABLE_HOSTS.csv.new'),'w') as f:
2461
- for key, value in oldDic.items():
2462
- f.write(f'{key},{value}\n')
2463
- os.replace(os.path.join(tempfile.gettempdir(),getpass.getuser()+'__multiSSH3_UNAVAILABLE_HOSTS.csv.new'),os.path.join(tempfile.gettempdir(),f'__{getpass.getuser()}_multiSSH3_UNAVAILABLE_HOSTS.csv'))
2464
- except Exception as e:
2465
- eprint(f'Error writing to temporary file: {e!r}')
2466
- import traceback
2467
- eprint(traceback.format_exc())
2425
+ # update the unavailable hosts and global unavailable hosts
2426
+ if willUpdateUnreachableHosts:
2427
+ availableHosts = set()
2428
+ for host in hosts:
2429
+ if host.stderr and ('No route to host' in host.stderr[0].strip() or 'Connection timed out' in host.stderr[0].strip() or (host.stderr[-1].strip().startswith('Timeout!') and host.returncode == 124)):
2430
+ unavailableHosts[host.name] = int(time.monotonic())
2431
+ __globalUnavailableHosts[host.name] = int(time.monotonic())
2432
+ else:
2433
+ availableHosts.add(host.name)
2434
+ if host.name in unavailableHosts:
2435
+ del unavailableHosts[host.name]
2436
+ if host.name in __globalUnavailableHosts:
2437
+ del __globalUnavailableHosts[host.name]
2438
+ if __DEBUG_MODE:
2439
+ print(f'Unreachable hosts: {unavailableHosts}')
2440
+ try:
2441
+ # check for the old content, only update if the new content is different
2442
+ if not os.path.exists(os.path.join(tempfile.gettempdir(),f'__{getpass.getuser()}_multiSSH3_UNAVAILABLE_HOSTS.csv')):
2443
+ with open(os.path.join(tempfile.gettempdir(),f'__{getpass.getuser()}_multiSSH3_UNAVAILABLE_HOSTS.csv'),'w') as f:
2444
+ f.writelines(f'{host},{expTime}' for host,expTime in unavailableHosts.items())
2445
+ else:
2446
+ oldDic = {}
2447
+ try:
2448
+ with open(os.path.join(tempfile.gettempdir(),f'__{getpass.getuser()}_multiSSH3_UNAVAILABLE_HOSTS.csv'),'r') as f:
2449
+ for line in f:
2450
+ line = line.strip()
2451
+ if line and ',' in line and len(line.split(',')) >= 2 and line.split(',')[0] and line.split(',')[1].isdigit():
2452
+ hostname = line.split(',')[0]
2453
+ expireTime = int(line.split(',')[1])
2454
+ if expireTime < time.monotonic() and hostname not in availableHosts:
2455
+ oldDic[hostname] = expireTime
2456
+ except:
2457
+ pass
2458
+ # add new entries
2459
+ oldDic.update(unavailableHosts)
2460
+ with open(os.path.join(tempfile.gettempdir(),getpass.getuser()+'__multiSSH3_UNAVAILABLE_HOSTS.csv.new'),'w') as f:
2461
+ for key, value in oldDic.items():
2462
+ f.write(f'{key},{value}\n')
2463
+ os.replace(os.path.join(tempfile.gettempdir(),getpass.getuser()+'__multiSSH3_UNAVAILABLE_HOSTS.csv.new'),os.path.join(tempfile.gettempdir(),f'__{getpass.getuser()}_multiSSH3_UNAVAILABLE_HOSTS.csv'))
2464
+ except Exception as e:
2465
+ eprint(f'Error writing to temporary file: {e!r}')
2466
+ import traceback
2467
+ eprint(traceback.format_exc())
2468
2468
 
2469
2469
  # print the output, if the output of multiple hosts are the same, we aggragate them
2470
2470
  if not called:
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes