From 97c082d629d6a090076cf9dcecd7d2316d35d825 Mon Sep 17 00:00:00 2001 From: Rohan Arora Date: Mon, 16 Jan 2017 16:12:05 -0600 Subject: [PATCH] Nosec subprocess with shell equal True from Bandit In an effort to clean up Bandit issues, these instances of subprocess being called with shell=True can be nosec'd as the commands being used are hardcoded and therefore are not security issues. Change-Id: I8d07f44e960d184cc1b4e136f4491f0bcf9c24ba --- cinder/config/generate_cinder_opts.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cinder/config/generate_cinder_opts.py b/cinder/config/generate_cinder_opts.py index af344681259..a7f819f0742 100644 --- a/cinder/config/generate_cinder_opts.py +++ b/cinder/config/generate_cinder_opts.py @@ -61,11 +61,13 @@ if __name__ == "__main__": '|/|g" | sort -u') cmd_opts = common_string % REGISTER_OPTS_STR - output_opts = subprocess.check_output('{}'.format(cmd_opts), shell=True) + output_opts = subprocess.check_output( # nosec : command is hardcoded + '{}'.format(cmd_opts), shell=True) dir_trees_list = output_opts.split() cmd_opt = common_string % REGISTER_OPT_STR - output_opt = subprocess.check_output('{}'.format(cmd_opt), shell=True) + output_opt = subprocess.check_output( # nosec : command is hardcoded + '{}'.format(cmd_opt), shell=True) temp_list = output_opt.split() for item in temp_list: