tempest cleanup fails on py35
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
tempest |
Fix Released
|
Undecided
|
Martin Kopec |
Bug Description
Not entirely sure what's going on, but `tempest cleanup` is broken after doing an initial `tempest cleanup --init-saved-state` successfully...
(venv) :~/tempest$ tempest cleanup
2018-11-30 16:57:05.950 12641 INFO tempest [-] Using tempest config file /etc/tempest/
2018-11-30 16:57:06.720 12641 INFO tempest.
2018-11-30 16:57:07.134 12641 INFO tempest.
2018-11-30 16:57:21.713 12641 INFO tempest.
2018-11-30 16:57:22.157 12641 INFO tempest.
2018-11-30 16:57:22.675 12641 INFO tempest.
2018-11-30 16:57:23.118 12641 INFO tempest.
2018-11-30 16:57:44.242 12641 INFO tempest.
2018-11-30 16:57:44.797 12641 INFO tempest.
2018-11-30 16:57:45.059 12641 INFO tempest.
2018-11-30 16:57:45.337 12641 INFO tempest.
2018-11-30 16:57:45.340 12641 ERROR tempest.cmd.cleanup [-] Exception parsing saved state json : can't concat str to bytes: TypeError: can't concat str to bytes
2018-11-30 16:57:45.340 12641 ERROR tempest.cmd.cleanup Traceback (most recent call last):
2018-11-30 16:57:45.340 12641 ERROR tempest.cmd.cleanup File "/home/
2018-11-30 16:57:45.340 12641 ERROR tempest.cmd.cleanup self.json_data = json.load(
2018-11-30 16:57:45.340 12641 ERROR tempest.cmd.cleanup File "/home/
2018-11-30 16:57:45.340 12641 ERROR tempest.cmd.cleanup return json.load(
2018-11-30 16:57:45.340 12641 ERROR tempest.cmd.cleanup File "/opt/python/
2018-11-30 16:57:45.340 12641 ERROR tempest.cmd.cleanup return loads(fp.read(),
2018-11-30 16:57:45.340 12641 ERROR tempest.cmd.cleanup File "/home/
2018-11-30 16:57:45.340 12641 ERROR tempest.cmd.cleanup data = self.bytebuffer + newdata
2018-11-30 16:57:45.340 12641 ERROR tempest.cmd.cleanup TypeError: can't concat str to bytes
2018-11-30 16:57:45.340 12641 ERROR tempest.cmd.cleanup
can't concat str to bytes
I've reproduced this issue on packstack rocky deployment: bin/activate
1. clone tempest master branch
2. Install tox python3 tox environment and source it:
$ tox -epy36
$ source .tox/py36/
3. Create saved_state.json and run cleanup:
$ tempest cleanup --init-saved-state
$ tempest cleanup
<the traceback as in the comment above>
The issue seems to be in python3 codecs library which expects to have new data in byte format not in string one like it is in python2. /stackoverflow. com/questions/ 45037676/ python- 3-6-urllib- typeerror- cant-concat- bytes-to- str
I've found the same problem described on stackoverflow:
https:/
So I guess, we just need to change the mode for reading the saved_state.json file.