Skip to content
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

Merged
merged 1 commit into from Mar 26, 2018

Conversation

Projects
None yet
2 participants
@rjfd
Copy link
Contributor

commented Mar 22, 2018

This PR fixes the problems found while running the dashboard in a python 3 only environment.

Signed-off-by: Ricardo Dias rdias@suse.com

@rjfd

This comment has been minimized.

Copy link
Contributor Author

commented Mar 22, 2018

PR #21006 is also fixing issues found while testing dashboard in python 3. Therefore, dashboard should be working in python 3 after this and #21006 is merged.

return self._resp.json()
except ValueError as ex:
log.error("response: %s", self._resp.text)
log.exception("Failed to decode response: %s", str(ex))

This comment has been minimized.

Copy link
@sebastian-philipp

sebastian-philipp Mar 22, 2018

Member

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?

This comment has been minimized.

Copy link
@rjfd

rjfd Mar 22, 2018

Author Contributor

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')

This comment has been minimized.

Copy link
@sebastian-philipp

sebastian-philipp Mar 22, 2018

Member

Interesting. this seems like a problem of the rbd python binding to me.

This comment has been minimized.

Copy link
@rjfd

rjfd Mar 22, 2018

Author Contributor

good point! will check rbd python binding implementation

This comment has been minimized.

Copy link
@rjfd

rjfd Mar 22, 2018

Author Contributor

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.

mgr/dashboard: fix dashboard python 3 support
Signed-off-by: Ricardo Dias <rdias@suse.com>

@rjfd rjfd force-pushed the rjfd:wip-dashboard-fix-py3 branch from 0784f27 to 25c75a9 Mar 22, 2018

@rjfd

This comment has been minimized.

Copy link
Contributor Author

commented Mar 23, 2018

@sebastian-philipp
Copy link
Member

left a comment

hard to test, but code looks resonable

@sebastian-philipp

This comment has been minimized.

Copy link
Member

commented Mar 23, 2018

while testing this, I ran into #21021

@rjfd rjfd merged commit a392e61 into ceph:master Mar 26, 2018

5 checks passed

Docs: build check OK - docs built
Details
Signed-off-by all commits in this PR are signed
Details
Unmodified Submodules submodules for project are unmodified
Details
make check make check succeeded
Details
make check (arm64) make check succeeded
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.