aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Barabas <peter.barabas@ericsson.com>2016-09-07 10:04:56 +0200
committerJonas Bjurel <jonas.bjurel@ericsson.com>2016-09-20 21:00:35 +0000
commit88f508f28e8f63b4fc8d57c50158269507fd5957 (patch)
treedc0c9d41d5819ec46fd9754df2902b89715d3d01
parentd1dd9f9d570e4fa9cc3be53f9072f12efeb474cd (diff)
Properly handle quotes in argument masking
Use shlex to parse the command line, thus handling quotes and other special characters. Change-Id: Icc3a2cd934aac8f67e07d967f76c7679bcb34996 Signed-off-by: Peter Barabas <peter.barabas@ericsson.com> (cherry picked from commit bddbf2a740b46d1ad763967b8c8662b1877a4d75)
-rw-r--r--deploy/common.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/deploy/common.py b/deploy/common.py
index 353045867..80832e201 100644
--- a/deploy/common.py
+++ b/deploy/common.py
@@ -18,6 +18,7 @@ import shutil
import stat
import errno
import time
+import shlex
N = {'id': 0, 'status': 1, 'name': 2, 'cluster': 3, 'ip': 4, 'mac': 5,
'roles': 6, 'pending_roles': 7, 'online': 8, 'group_id': 9}
@@ -41,7 +42,7 @@ os.chmod(LOGFILE, 0664)
def mask_arguments(cmd, mask_args, mask_str):
- cmd_line = cmd.split()
+ cmd_line = shlex.split(cmd)
for pos in mask_args:
# Don't mask the actual command; also check if we don't reference
# beyond bounds