From 87efcc812b65e3a4b2db9fb54b198407c6c1f9ce Mon Sep 17 00:00:00 2001 From: Pritpal Sabharwal Date: Thu, 16 Mar 2017 10:49:30 +0000 Subject: [PATCH] Pass arguments for shell command as elements in a list. When shell=False, subprocess interprets the string as the name of an executable (including spaces) and fails to run. --- bootstrapvz/plugins/admin_user/tasks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrapvz/plugins/admin_user/tasks.py b/bootstrapvz/plugins/admin_user/tasks.py index 9d7e012..9ba33bf 100644 --- a/bootstrapvz/plugins/admin_user/tasks.py +++ b/bootstrapvz/plugins/admin_user/tasks.py @@ -23,7 +23,7 @@ class CheckPublicKeyFile(Task): msg = 'Could not find public key at %s' % pubkey info.manifest.validation_error(msg, ['plugins', 'admin_user', 'pubkey']) - ret, _, stderr = log_call('ssh-keygen -l -f ' + abs_pubkey) + ret, _, stderr = log_call(['ssh-keygen', '-l', '-f', abs_pubkey]) if ret != 0: msg = 'Invalid public key file at %s' % pubkey info.manifest.validation_error(msg, ['plugins', 'admin_user', 'pubkey'])