Squish: Do not use shell in getOutputFromCmdline

Change-Id: I731b119169063912cd3b528a1a6a58727002ae67
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Robert Loehning
2016-05-26 18:51:15 +02:00
parent b4e11b191b
commit c1e7cf84e4
7 changed files with 20 additions and 18 deletions
+6 -4
View File
@@ -224,16 +224,18 @@ class JIRA:
def __tryExternalTools__(self, proxy=None):
global JIRA_URL
if proxy:
cmdAndArgs = { 'curl':'-k --proxy %s' % proxy,
'wget':'-qO-'}
cmdAndArgs = { 'curl':['-k', '--proxy', proxy],
'wget':['-qO-']}
else:
cmdAndArgs = { 'curl':'-k', 'wget':'-qO-' }
cmdAndArgs = { 'curl':['-k'], 'wget':['-qO-']}
for call in cmdAndArgs:
prog = which(call)
if prog:
if call == 'wget' and proxy and os.getenv("https_proxy", None) == None:
test.warning("Missing environment variable https_proxy for using wget with proxy!")
return getOutputFromCmdline('"%s" %s %s/%s-%d' % (prog, cmdAndArgs[call], JIRA_URL, self._bugType, self._number))
cmdline = [prog] + cmdAndArgs[call]
cmdline += ['%s/%s-%d' % (JIRA_URL, self._bugType, self._number)]
return getOutputFromCmdline(cmdline)
return None
# this function crops multiple whitespaces from fetched and searches for expected