[elbe-devel] [PATCH 5/8] elbepack: initvmaction: switch to non-shell syntax
Thomas Weißschuh
thomas.weissschuh at linutronix.de
Wed May 15 13:32:21 CEST 2024
The shell syntax is error-prone and a mess of nested quoting syntax.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>
Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>
---
elbepack/initvmaction.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/elbepack/initvmaction.py b/elbepack/initvmaction.py
index 0fee9ac0e2c3..11f2b90e2a53 100644
--- a/elbepack/initvmaction.py
+++ b/elbepack/initvmaction.py
@@ -856,11 +856,12 @@ class SyncAction(InitVMAction):
def execute(self, _initvmdir, _opt, _args):
top_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
excludes = ['.git*', '*.pyc', 'elbe-build*', 'initvm', '__pycache__', 'docs', 'examples']
+ ssh = ' '.join(['ssh', '-p', cfg['sshport'], '-oUserKnownHostsFile=/dev/null'])
try:
subprocess.run([
'rsync', '--info=name1,stats1', '--archive', '--times',
*[arg for e in excludes for arg in ('--exclude', e)],
- f'--rsh=ssh -p {cfg["sshport"]} -oUserKnownHostsFile=/dev/null',
+ '--rsh', ssh,
'--chown=root:root',
f'{top_dir}/elbe',
f'{top_dir}/elbepack',
--
2.45.0
More information about the elbe-devel
mailing list