+os.chmod(LOGFILE, 0664)
+
+
+def mask_arguments(cmd, mask_args, mask_str):
+ cmd_line = cmd.split()
+ for pos in mask_args:
+ # Don't mask the actual command; also check if we don't reference
+ # beyond bounds
+ if pos == 0 or pos >= len(cmd_line):
+ continue
+ cmd_line[pos] = mask_str
+ return ' '.join(cmd_line)
+
+
+def exec_cmd(cmd, check=True, attempts=1, delay=5, verbose=False, mask_args=[], mask_str='*****'):
+ masked_cmd = mask_arguments(cmd, mask_args, mask_str)