multiCMD 1.24__tar.gz → 1.25__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: multiCMD
3
- Version: 1.24
3
+ Version: 1.25
4
4
  Summary: Run commands simultaneously
5
5
  Home-page: https://github.com/yufei-pan/multiCMD
6
6
  Author: Yufei Pan
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: multiCMD
3
- Version: 1.24
3
+ Version: 1.25
4
4
  Summary: Run commands simultaneously
5
5
  Home-page: https://github.com/yufei-pan/multiCMD
6
6
  Author: Yufei Pan
@@ -18,7 +18,7 @@ import re
18
18
  import itertools
19
19
  import signal
20
20
 
21
- version = '1.24'
21
+ version = '1.25'
22
22
  __version__ = version
23
23
 
24
24
  __running_threads = []
@@ -283,6 +283,11 @@ def ping(hosts,timeout=1,max_threads=0,quiet=True,dry_run=False,with_stdErr=Fals
283
283
  @returns:
284
284
  None | int | list[str] | Task: The output of the command
285
285
  '''
286
+ if isinstance(hosts,str):
287
+ commands = [f'ping -c 1 {hosts}']
288
+ return run_commands(commands, timeout=timeout, max_threads=max_threads, quiet=quiet,
289
+ dry_run=dry_run, with_stdErr=with_stdErr, return_code_only=return_code_only,
290
+ return_object=return_object,wait_for_return=wait_for_return)[0]
286
291
  commands = [f'ping -c 1 {host}' for host in hosts]
287
292
  return run_commands(commands, timeout=timeout, max_threads=max_threads, quiet=quiet,
288
293
  dry_run=dry_run, with_stdErr=with_stdErr, return_code_only=return_code_only,
File without changes
File without changes
File without changes