Decrease SSH timeout when pushing config to nodes

This commit is contained in:
Timotej Lazar 2023-01-26 16:15:08 +01:00
parent 0ded9d3823
commit 388061130e

View file

@ -161,8 +161,9 @@ def push(version=None):
# Push config tarfile. # Push config tarfile.
syslog.syslog(f'updating {node} from {node_version} to {version}') syslog.syslog(f'updating {node} from {node_version} to {version}')
result = subprocess.run([f'sftp root@{node}'], shell=True, text=True, result = subprocess.run([f'sftp -o ConnectTimeout=10 root@{node}'],
input=f'put {tarfile}\nput config/version\n', capture_output=True) shell=True, text=True, capture_output=True,
input=f'put {tarfile}\nput config/version\n')
if result.returncode == 0: if result.returncode == 0:
nodes[node] = version nodes[node] = version
db.write('nodes', nodes) db.write('nodes', nodes)