multiSSH3 5.50__py3-none-any.whl → 5.51__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.50.dist-info → multiSSH3-5.51.dist-info}/METADATA +1 -1
- multiSSH3-5.51.dist-info/RECORD +6 -0
- multiSSH3.py +26 -5
- multiSSH3-5.50.dist-info/RECORD +0 -6
- {multiSSH3-5.50.dist-info → multiSSH3-5.51.dist-info}/WHEEL +0 -0
- {multiSSH3-5.50.dist-info → multiSSH3-5.51.dist-info}/entry_points.txt +0 -0
- {multiSSH3-5.50.dist-info → multiSSH3-5.51.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
multiSSH3.py,sha256=TAJFAL4Lj-iLOtSsx6C9ThpKmbosacKwJC_3qEr6bHE,137930
|
|
2
|
+
multiSSH3-5.51.dist-info/METADATA,sha256=fDnMwAqedzYc_MhrMfUHD9SuA_E5zI-UQlB05oJmbM4,18092
|
|
3
|
+
multiSSH3-5.51.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
4
|
+
multiSSH3-5.51.dist-info/entry_points.txt,sha256=xi2rWWNfmHx6gS8Mmx0rZL2KZz6XWBYP3DWBpWAnnZ0,143
|
|
5
|
+
multiSSH3-5.51.dist-info/top_level.txt,sha256=tUwttxlnpLkZorSsroIprNo41lYSxjd2ASuL8-EJIJw,10
|
|
6
|
+
multiSSH3-5.51.dist-info/RECORD,,
|
multiSSH3.py
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
|
+
# /// script
|
|
3
|
+
# requires-python = ">=3.6"
|
|
4
|
+
# dependencies = [
|
|
5
|
+
# "argparse",
|
|
6
|
+
# "ipaddress",
|
|
7
|
+
# ]
|
|
8
|
+
# ///
|
|
2
9
|
__curses_available = False
|
|
3
10
|
__resource_lib_available = False
|
|
4
11
|
try:
|
|
@@ -47,7 +54,7 @@ except AttributeError:
|
|
|
47
54
|
# If neither is available, use a dummy decorator
|
|
48
55
|
def cache_decorator(func):
|
|
49
56
|
return func
|
|
50
|
-
version = '5.
|
|
57
|
+
version = '5.51'
|
|
51
58
|
VERSION = version
|
|
52
59
|
__version__ = version
|
|
53
60
|
COMMIT_DATE = '2025-01-30'
|
|
@@ -1359,7 +1366,7 @@ def run_command(host, sem, timeout=60,passwds=None, retry_limit = 5):
|
|
|
1359
1366
|
# Monitor the subprocess and terminate it after the timeout
|
|
1360
1367
|
host.lastUpdateTime = time.time()
|
|
1361
1368
|
timeoutLineAppended = False
|
|
1362
|
-
sleep_interval = 1.0e-
|
|
1369
|
+
sleep_interval = 1.0e-7 # 100 nanoseconds
|
|
1363
1370
|
while proc.poll() is None: # while the process is still running
|
|
1364
1371
|
if timeout > 0:
|
|
1365
1372
|
if time.time() - host.lastUpdateTime > timeout:
|
|
@@ -2264,13 +2271,27 @@ def print_output(hosts,usejson = False,quiet = False,greppable = False):
|
|
|
2264
2271
|
def processRunOnHosts(timeout, password, max_connections, hosts, returnUnfinished, nowatch, json, called, greppable,unavailableHosts,willUpdateUnreachableHosts,curses_min_char_len = DEFAULT_CURSES_MINIMUM_CHAR_LEN, curses_min_line_len = DEFAULT_CURSES_MINIMUM_LINE_LEN,single_window = DEFAULT_SINGLE_WINDOW):
|
|
2265
2272
|
global __globalUnavailableHosts
|
|
2266
2273
|
global _no_env
|
|
2274
|
+
sleep_interval = 1.0e-7 # 0.1 microseconds
|
|
2267
2275
|
threads = start_run_on_hosts(hosts, timeout=timeout,password=password,max_connections=max_connections)
|
|
2268
|
-
if __curses_available and not nowatch and threads and not returnUnfinished
|
|
2269
|
-
|
|
2276
|
+
if __curses_available and not nowatch and threads and not returnUnfinished and sys.stdout.isatty() and os.get_terminal_size() and os.get_terminal_size().columns > 10:
|
|
2277
|
+
total_sleeped = 0
|
|
2278
|
+
while any([host.returncode is None for host in hosts]):
|
|
2279
|
+
time.sleep(sleep_interval) # avoid busy-waiting
|
|
2280
|
+
total_sleeped += sleep_interval
|
|
2281
|
+
if sleep_interval < 0.001:
|
|
2282
|
+
sleep_interval *= 2
|
|
2283
|
+
elif sleep_interval < 0.01:
|
|
2284
|
+
sleep_interval *= 1.1
|
|
2285
|
+
if total_sleeped > 0.1:
|
|
2286
|
+
break
|
|
2287
|
+
if any([host.returncode is None for host in hosts]):
|
|
2288
|
+
curses.wrapper(curses_print, hosts, threads, min_char_len = curses_min_char_len, min_line_len = curses_min_line_len, single_window = single_window)
|
|
2270
2289
|
if not returnUnfinished:
|
|
2271
2290
|
# wait until all hosts have a return code
|
|
2272
2291
|
while any([host.returncode is None for host in hosts]):
|
|
2273
|
-
time.sleep(
|
|
2292
|
+
time.sleep(sleep_interval) # avoid busy-waiting
|
|
2293
|
+
if sleep_interval < 0.01:
|
|
2294
|
+
sleep_interval *= 1.1
|
|
2274
2295
|
for thread in threads:
|
|
2275
2296
|
thread.join(timeout=3)
|
|
2276
2297
|
# update the unavailable hosts and global unavailable hosts
|
multiSSH3-5.50.dist-info/RECORD
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
multiSSH3.py,sha256=4XPEcfGf7Gqq0YvVvsAve4x5Afb4Nse_0_nRJTm5T6A,137371
|
|
2
|
-
multiSSH3-5.50.dist-info/METADATA,sha256=63ZfVMNdX55SxVFWL8EogyLiOHWDerdjsVovEbNCBf8,18092
|
|
3
|
-
multiSSH3-5.50.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
4
|
-
multiSSH3-5.50.dist-info/entry_points.txt,sha256=xi2rWWNfmHx6gS8Mmx0rZL2KZz6XWBYP3DWBpWAnnZ0,143
|
|
5
|
-
multiSSH3-5.50.dist-info/top_level.txt,sha256=tUwttxlnpLkZorSsroIprNo41lYSxjd2ASuL8-EJIJw,10
|
|
6
|
-
multiSSH3-5.50.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|