aboutsummaryrefslogtreecommitdiffstats
path: root/meta-openstack
diff options
context:
space:
mode:
authorVu Tran <vu.tran@windriver.com>2014-07-10 10:23:50 -0400
committerBruce Ashfield <bruce.ashfield@windriver.com>2014-07-17 00:14:05 -0400
commit41db8eb7ca31800e04c996fe943ecdaf632cfa0f (patch)
tree6602b47d33b554a8c2f81da49c3655fbbfbcf666 /meta-openstack
parent65e79ec56007de4a4445cc59d3d7e8381bc25181 (diff)
downloadmeta-cloud-services-41db8eb7ca31800e04c996fe943ecdaf632cfa0f.tar.gz
meta-cloud-services-41db8eb7ca31800e04c996fe943ecdaf632cfa0f.tar.bz2
meta-cloud-services-41db8eb7ca31800e04c996fe943ecdaf632cfa0f.zip
rally: verification subunit2json fail to open result file
Command "rally verify start" gives the following error: TRACE rally File "/usr/lib64/python2.7/site-packages/rally/verification/verifiers/tempest/subunit2json.py", line 113, in stopTestRun TRACE rally with open(self.results_file, 'wb') as results_file: TRACE rally TypeError: coercing to Unicode: need string or buffer, int found For Python 2.x, open() requires a string but not file descriptor number. However for Python 3.x, open() can either accept a string file name of a file descriptor number. So modify code to pass in open() string file name. This should work for both Python 2.x and 3.x Signed-off-by: Vu Tran <vu.tran@windriver.com>
Diffstat (limited to 'meta-openstack')
-rw-r--r--meta-openstack/recipes-devtools/python/python-rally/verification-subunit2json-fail-to-open-result-file.patch36
-rw-r--r--meta-openstack/recipes-devtools/python/python-rally_git.bb1
2 files changed, 37 insertions, 0 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-rally/verification-subunit2json-fail-to-open-result-file.patch b/meta-openstack/recipes-devtools/python/python-rally/verification-subunit2json-fail-to-open-result-file.patch
new file mode 100644
index 00000000..7257740f
--- /dev/null
+++ b/meta-openstack/recipes-devtools/python/python-rally/verification-subunit2json-fail-to-open-result-file.patch
@@ -0,0 +1,36 @@
+verification: subunit2json fail to open result file
+
+Command "rally verify start" gives the following error:
+
+TRACE rally File "/usr/lib64/python2.7/site-packages/rally/verification/verifiers/tempest/subunit2json.py", line 113, in stopTestRun
+TRACE rally with open(self.results_file, 'wb') as results_file:
+TRACE rally TypeError: coercing to Unicode: need string or buffer, int found
+
+Python open() requires a string but not file discriptor number.
+
+Signed-off-by: Vu Tran <vu.tran@windriver.com>
+
+diff --git a/rally/verification/verifiers/tempest/subunit2json.py b/rally/verification/verifiers/tempest/subunit2json.py
+index 719f814..f74b13c 100644
+--- a/rally/verification/verifiers/tempest/subunit2json.py
++++ b/rally/verification/verifiers/tempest/subunit2json.py
+@@ -137,7 +137,7 @@ class FileAccumulator(testtools.StreamResult):
+
+
+ def main(subunit_log_file):
+- results_file, _ = tempfile.mkstemp()
++ _, results_file = tempfile.mkstemp()
+ result = JsonOutput(results_file)
+ stream = open(subunit_log_file, 'rb')
+
+@@ -161,8 +161,8 @@ def main(subunit_log_file):
+ suite = subunit.ProtocolTestCase(bytes_io)
+ suite.run(result)
+ result.stopTestRun()
+- with open(results_file, 'rb') as results_file:
+- data = results_file.read()
++ with open(results_file, 'rb') as results_file_fd:
++ data = results_file_fd.read()
+ try:
+ os.unlink(results_file)
+ except OSError as e:
diff --git a/meta-openstack/recipes-devtools/python/python-rally_git.bb b/meta-openstack/recipes-devtools/python/python-rally_git.bb
index 360e89fc..30e3283a 100644
--- a/meta-openstack/recipes-devtools/python/python-rally_git.bb
+++ b/meta-openstack/recipes-devtools/python/python-rally_git.bb
@@ -17,6 +17,7 @@ SRC_URI = "git://github.com/stackforge/${SRCNAME}.git;branch=master \
file://remove-ironic-support.patch \
file://verification-to-use-existing-tempest.patch \
file://sqlalchemy-db-missing-name-for-ENUM.patch \
+ file://verification-subunit2json-fail-to-open-result-file.patch \
"
SRCREV="b297cf00750f263b8b5bdeb71f6952f672e87f5a"