summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Wittenburg <scott.wittenburg@kitware.com>2018-10-24 15:22:59 -0600
committerTodd Gamblin <tgamblin@llnl.gov>2018-12-20 09:23:08 -0800
commit7217b4a4b9ba05176a7382d6408923067b31b330 (patch)
treebab84b27c3e0a06ab06c65f8d6efb23d42ce90c9
parentaed9a532c6edb24f336aa8a5114ad465b22c318c (diff)
downloadspack-7217b4a4b9ba05176a7382d6408923067b31b330.tar.gz
spack-7217b4a4b9ba05176a7382d6408923067b31b330.tar.bz2
spack-7217b4a4b9ba05176a7382d6408923067b31b330.tar.xz
spack-7217b4a4b9ba05176a7382d6408923067b31b330.zip
Make sure to urlencode cdash submit parameters
-rw-r--r--lib/spack/spack/reporters/cdash.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/spack/spack/reporters/cdash.py b/lib/spack/spack/reporters/cdash.py
index 2f74e4ec0d..38ed96a448 100644
--- a/lib/spack/spack/reporters/cdash.py
+++ b/lib/spack/spack/reporters/cdash.py
@@ -14,6 +14,7 @@ import time
import xml.sax.saxutils
from six import text_type
from six.moves.urllib.request import build_opener, HTTPHandler, Request
+from six.moves.urllib.parse import urlencode
import spack.build_environment
import spack.fetch_strategy
@@ -197,9 +198,14 @@ class CDash(Reporter):
buildid_regexp = re.compile("<buildId>([0-9]+)</buildId>")
opener = build_opener(HTTPHandler)
with open(filename, 'rb') as f:
- url = "{0}&build={1}&site={2}&stamp={3}&MD5={4}".format(
- self.cdash_upload_url, self.buildname, self.site,
- self.buildstamp, md5sum)
+ params_dict = {
+ 'build': self.buildname,
+ 'site': self.site,
+ 'stamp': self.buildstamp,
+ 'MD5': md5sum,
+ }
+ encoded_params = urlencode(params_dict)
+ url = "{0}&{1}".format(self.cdash_upload_url, encoded_params)
request = Request(url, data=f)
request.add_header('Content-Type', 'text/xml')
request.add_header('Content-Length', os.path.getsize(filename))