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 v2: implement can_run method #20728

Merged
merged 1 commit into from Mar 14, 2018

Conversation

Projects
None yet
4 participants
@jcsp
Copy link
Contributor

commented Mar 5, 2018

This is just to give us friendlier behaviour if anything the dashboard expects is missing.

@jcsp jcsp force-pushed the jcsp:wip-dashboard-can_run branch from 6d28aed to 756c759 Mar 6, 2018

@jcsp jcsp changed the title [DNM] mgr/dashboard v2: implement can_run method mgr/dashboard v2: implement can_run method Mar 6, 2018

@jcsp jcsp removed the DNM label Mar 6, 2018

@jcsp jcsp requested a review from sebastian-philipp Mar 6, 2018

@@ -74,6 +79,20 @@ def __init__(self, *args, **kwargs):
mgr.init(self)
self._url_prefix = ''

def can_run(self):
if cherrypy is None:

This comment has been minimized.

Copy link
@rjfd

rjfd Mar 6, 2018

Contributor

we also need "bcrypt" package for the authentication to work, can we also add that check to this method?

@LenzGr

LenzGr approved these changes Mar 6, 2018

Copy link
Contributor

left a comment

LGTM, thank you!

@rjfd

This comment has been minimized.

Copy link
Contributor

commented Mar 12, 2018

@jcsp regarding the bcrypt comment I left, do you think it's not worth it to add at this point?

@jcsp

This comment has been minimized.

Copy link
Contributor Author

commented Mar 12, 2018

@rjfd the awkward thing about checking for bcrypt is that it's not directly used in module.py, so we'd need a more general approach where we're catching the ImportError from the other modules too -- it could be interesting to do that by separating the web server into a separate .py so that we could readily catch all import errors while importing that from module.py, but that's probably for another day

@rjfd

This comment has been minimized.

Copy link
Contributor

commented Mar 12, 2018

@jcsp I agree with you, importing bcrypt is not very elegant. In that case I'm fine with merging the PR as it is.

@rjfd

rjfd approved these changes Mar 12, 2018

Copy link
Contributor

left a comment

lgtm

@rjfd rjfd added the needs-qa label Mar 12, 2018

@@ -74,6 +79,20 @@ def __init__(self, *args, **kwargs):
mgr.init(self)
self._url_prefix = ''

def can_run(self):

This comment has been minimized.

Copy link
@rjfd

rjfd Mar 12, 2018

Contributor

the can_run method in ../mgr_module.py is declared as a static method. As it is declared here breaks the module loading. Please make this a static method.

This comment has been minimized.

Copy link
@jcsp

jcsp Mar 12, 2018

Author Contributor

Oops. Updated. Had to un-property-ize the frontend_path method to get it usable from here too.

John Spray
mgr/dashboard: implement can_run checks for dashboard v2
Should be especially handy in development environments
for giving a clear message for people who have forgotten
to build frontend bits.

Signed-off-by: John Spray <john.spray@redhat.com>

@jcsp jcsp force-pushed the jcsp:wip-dashboard-can_run branch from 756c759 to b4190be Mar 12, 2018

@rjfd rjfd added wip-rdias-testing and removed needs-qa labels Mar 13, 2018

@rjfd

This comment has been minimized.

@rjfd

rjfd approved these changes Mar 14, 2018

@rjfd rjfd removed the wip-rdias-testing label Mar 14, 2018

@LenzGr LenzGr merged commit 5dfdecc into ceph:master Mar 14, 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

epuertat added a commit to rhcs-dashboard/ceph that referenced this pull request Jul 17, 2018

Merge pull request ceph#20728 from jcsp/wip-dashboard-can_run
mgr/dashboard v2: implement can_run method

Reviewed-by: Ricardo Dias <rdias@suse.com>
Reviewed-by: Sebastian Wagner <sebastian.wagner@suse.com>
(cherry picked from commit 5dfdecc)
Signed-off-by: Ernesto Puerta <epuertat@redhat.com>
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.