mirror of
https://github.com/rwinkhart/sshyp.git
synced 2026-08-28 04:46:34 -04:00
Use subprocess.run without shell=True where easily applicable, redirect unused captured output to DEVNULL
Former-commit-id: bae14d658f4e1fa04f723e8545bc35d69e0c4cbb [formerly 3a85f06ffe]
Former-commit-id: 7b7b48c870b9a6d4646d9be3d208ea792e665399
This commit is contained in:
+3
-3
@@ -20,9 +20,9 @@ def get_local_data(_directory, _device): # retrieves titles and mod times from
|
||||
|
||||
|
||||
def get_remote_data(_user_data): # retrieves titles and mod times from the remote server
|
||||
_titles_mods = run(f"ssh -i '{_user_data[5]}' -p {_user_data[2]} {_user_data[0]}@{_user_data[1]} \"cd /lib/sshyp; "
|
||||
f"python -c 'import sshync; sshync.get_local_data(\"'\"{_user_data[4]}\"'\", \"'\"server\"'\")"
|
||||
f"'\"", shell=True, stdout=PIPE, text=True).stdout.split('\n')
|
||||
_titles_mods = run(['ssh', '-i', _user_data[5], '-p', _user_data[2], f"{_user_data[0]}@{_user_data[1]}",
|
||||
f'cd /lib/sshyp; python -c \'import sshync; sshync.get_local_data("{_user_data[4]}", '
|
||||
f'"server")\''], stdout=PIPE, text=True).stdout.split('\n')
|
||||
_title_list = _titles_mods[:len(_titles_mods)//2]
|
||||
_mod_list = _titles_mods[len(_titles_mods)//2:]
|
||||
return _title_list, _mod_list
|
||||
|
||||
Reference in New Issue
Block a user