multiSSH3 5.41__py3-none-any.whl → 5.43__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.
- {multiSSH3-5.41.dist-info → multiSSH3-5.43.dist-info}/METADATA +377 -376
- multiSSH3-5.43.dist-info/RECORD +6 -0
- multiSSH3.py +12 -6
- multiSSH3-5.41.dist-info/LICENSE +0 -674
- multiSSH3-5.41.dist-info/RECORD +0 -7
- {multiSSH3-5.41.dist-info → multiSSH3-5.43.dist-info}/WHEEL +0 -0
- {multiSSH3-5.41.dist-info → multiSSH3-5.43.dist-info}/entry_points.txt +0 -0
- {multiSSH3-5.41.dist-info → multiSSH3-5.43.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
multiSSH3.py,sha256=XcI427f_uDAZzhRVSrnGa2CLQbEIcRfNHuRxGm-hC-c,138864
|
|
2
|
+
multiSSH3-5.43.dist-info/METADATA,sha256=aRmafYNhFOtGQDjkn4biNypqy01CJ1Y35eMwok4udYk,18001
|
|
3
|
+
multiSSH3-5.43.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
4
|
+
multiSSH3-5.43.dist-info/entry_points.txt,sha256=xi2rWWNfmHx6gS8Mmx0rZL2KZz6XWBYP3DWBpWAnnZ0,143
|
|
5
|
+
multiSSH3-5.43.dist-info/top_level.txt,sha256=tUwttxlnpLkZorSsroIprNo41lYSxjd2ASuL8-EJIJw,10
|
|
6
|
+
multiSSH3-5.43.dist-info/RECORD,,
|
multiSSH3.py
CHANGED
|
@@ -45,7 +45,7 @@ except AttributeError:
|
|
|
45
45
|
# If neither is available, use a dummy decorator
|
|
46
46
|
def cache_decorator(func):
|
|
47
47
|
return func
|
|
48
|
-
version = '5.
|
|
48
|
+
version = '5.43'
|
|
49
49
|
VERSION = version
|
|
50
50
|
|
|
51
51
|
CONFIG_FILE = '/etc/multiSSH3.config.json'
|
|
@@ -1156,7 +1156,7 @@ def __handle_writing_stream(stream,stop_event,host):
|
|
|
1156
1156
|
sentInput += 1
|
|
1157
1157
|
host.lastUpdateTime = time.time()
|
|
1158
1158
|
else:
|
|
1159
|
-
time.sleep(0.
|
|
1159
|
+
time.sleep(0.01) # sleep for 10ms
|
|
1160
1160
|
if sentInput < len(__keyPressesIn) - 1 :
|
|
1161
1161
|
eprint(f"Warning: {len(__keyPressesIn)-sentInput} key presses are not sent before the process is terminated!")
|
|
1162
1162
|
# # send the last line
|
|
@@ -1364,6 +1364,7 @@ def run_command(host, sem, timeout=60,passwds=None, retry_limit = 5):
|
|
|
1364
1364
|
# Monitor the subprocess and terminate it after the timeout
|
|
1365
1365
|
host.lastUpdateTime = time.time()
|
|
1366
1366
|
timeoutLineAppended = False
|
|
1367
|
+
sleep_interval = 1.0e-8 # 10 nanoseconds
|
|
1367
1368
|
while proc.poll() is None: # while the process is still running
|
|
1368
1369
|
if timeout > 0:
|
|
1369
1370
|
if time.time() - host.lastUpdateTime > timeout:
|
|
@@ -1371,7 +1372,6 @@ def run_command(host, sem, timeout=60,passwds=None, retry_limit = 5):
|
|
|
1371
1372
|
host.output.append('Timeout!')
|
|
1372
1373
|
proc.send_signal(signal.SIGINT)
|
|
1373
1374
|
time.sleep(0.1)
|
|
1374
|
-
|
|
1375
1375
|
proc.terminate()
|
|
1376
1376
|
break
|
|
1377
1377
|
elif time.time() - host.lastUpdateTime > max(1, timeout // 2):
|
|
@@ -1395,7 +1395,11 @@ def run_command(host, sem, timeout=60,passwds=None, retry_limit = 5):
|
|
|
1395
1395
|
time.sleep(0.1)
|
|
1396
1396
|
proc.terminate()
|
|
1397
1397
|
break
|
|
1398
|
-
time.sleep(
|
|
1398
|
+
time.sleep(sleep_interval) # avoid busy-waiting
|
|
1399
|
+
if sleep_interval < 0.001:
|
|
1400
|
+
sleep_interval *= 2
|
|
1401
|
+
elif sleep_interval < 0.01:
|
|
1402
|
+
sleep_interval *= 1.1
|
|
1399
1403
|
stdin_stop_event.set()
|
|
1400
1404
|
# Wait for output processing to complete
|
|
1401
1405
|
stdout_thread.join(timeout=1)
|
|
@@ -1416,12 +1420,14 @@ def run_command(host, sem, timeout=60,passwds=None, retry_limit = 5):
|
|
|
1416
1420
|
__handle_reading_stream(io.BytesIO(stderr),host.stderr, host)
|
|
1417
1421
|
# if the last line in host.stderr is Connection to * closed., we will remove it
|
|
1418
1422
|
host.returncode = proc.poll()
|
|
1419
|
-
if
|
|
1423
|
+
if host.returncode is None:
|
|
1420
1424
|
# process been killed via timeout or sigkill
|
|
1421
1425
|
if host.stderr and host.stderr[-1].strip().startswith('Timeout!'):
|
|
1422
1426
|
host.returncode = 124
|
|
1423
1427
|
elif host.stderr and host.stderr[-1].strip().startswith('Ctrl C detected, Emergency Stop!'):
|
|
1424
1428
|
host.returncode = 137
|
|
1429
|
+
else:
|
|
1430
|
+
host.returncode = -1
|
|
1425
1431
|
host.output.append(f'Command finished with return code {host.returncode}')
|
|
1426
1432
|
if host.stderr:
|
|
1427
1433
|
# filter out the error messages that we want to ignore
|
|
@@ -2258,7 +2264,7 @@ def processRunOnHosts(timeout, password, max_connections, hosts, returnUnfinishe
|
|
|
2258
2264
|
if not returnUnfinished:
|
|
2259
2265
|
# wait until all hosts have a return code
|
|
2260
2266
|
while any([host.returncode is None for host in hosts]):
|
|
2261
|
-
time.sleep(0.
|
|
2267
|
+
time.sleep(0.01)
|
|
2262
2268
|
for thread in threads:
|
|
2263
2269
|
thread.join(timeout=3)
|
|
2264
2270
|
# update the unavailable hosts and global unavailable hosts
|