summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Windisch <eric@cloudscaling.com>2011-02-27 20:28:04 -0500
committerEric Windisch <eric@cloudscaling.com>2011-02-27 20:28:04 -0500
commit38c21546ecc079300c575e5950bcb990eecee3a3 (patch)
treebbc698a8f426dab5f684901a87d12b5e1bb65163
parentedf5da85648659b1a7ad105248d69ef9f8c977e4 (diff)
execute: shell=True removed.
-rw-r--r--nova/utils.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/nova/utils.py b/nova/utils.py
index 0cf91e0cc..40a8d8d8c 100644
--- a/nova/utils.py
+++ b/nova/utils.py
@@ -125,7 +125,7 @@ def fetchfile(url, target):
# c.perform()
# c.close()
# fp.close()
- execute("curl --fail %s -o %s" % (url, target))
+ execute("curl","--fail",url,"-o",target)
def execute(cmd, process_input=None, addl_env=None, check_exit_code=True):
@@ -133,7 +133,7 @@ def execute(cmd, process_input=None, addl_env=None, check_exit_code=True):
env = os.environ.copy()
if addl_env:
env.update(addl_env)
- obj = subprocess.Popen(cmd, shell=True, stdin=subprocess.PIPE,
+ obj = subprocess.Popen(cmd, stdin=subprocess.PIPE,
stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env)
result = None
if process_input != None:
@@ -254,7 +254,7 @@ def last_octet(address):
def get_my_linklocal(interface):
try:
- if_str = execute("ip -f inet6 -o addr show %s" % interface)
+ if_str = execute("ip","-f","inet6","-o","addr","show", interface)
condition = "\s+inet6\s+([0-9a-f:]+)/\d+\s+scope\s+link"
links = [re.search(condition, x) for x in if_str[0].split('\n')]
address = [w.group(1) for w in links if w is not None]