New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mgr/dashboard: fix dashboard python 3 support #21007
Conversation
qa/tasks/mgr/dashboard/helper.py
Outdated
return self._resp.json() | ||
except ValueError as ex: | ||
log.error("response: %s", self._resp.text) | ||
log.exception("Failed to decode response: %s", str(ex)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need to add str(ex)
to log.exception. it does that automatically. I'd use
log.exception("Failed to decode response: %s", self._resp.text)
instead.
Also, you're silently returning None
here, Can we re-throw the exception here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed as you suggested
@@ -76,6 +76,7 @@ def _rbd_list(self, pool_name): | |||
features = i.features() | |||
stat['features'] = features | |||
stat['features_name'] = self._format_bitmask(features) | |||
stat['parent_name'] = stat['parent_name'].decode('utf8') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting. this seems like a problem of the rbd
python binding to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point! will check rbd python binding implementation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked the rbd python binding implementation and the parent_name
and parent_pool
are already deprecated, so I changed the code to remove those two keys from the dictionary.
Signed-off-by: Ricardo Dias <rdias@suse.com>
0784f27
to
25c75a9
Compare
QA tests run successfully: http://pulpito.ceph.com/rdias-2018-03-22_16:43:51-rados:mgr-wip-rdias-testing-distro-basic-smithi/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hard to test, but code looks resonable
while testing this, I ran into #21021 |
This PR fixes the problems found while running the dashboard in a python 3 only environment.
Signed-off-by: Ricardo Dias rdias@suse.com