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 500 error on block device iSCSI status page #20928

Merged
merged 1 commit into from Mar 16, 2018

Conversation

dillaman
Copy link

Signed-off-by: Jason Dillaman dillaman@redhat.com

@dillaman
Copy link
Author

screenshot from 2018-03-15 17-40-12

@rjfd
Copy link
Contributor

rjfd commented Mar 16, 2018

@dillaman thanks for fixing this! it's very hard for us to test this backend controller (and frontend).

Could you also fix the unit test tests/test_tcmu_iscsi.py in this PR using a sample real data in the mocks?

@dillaman
Copy link
Author

@rjfd I have no idea how to run the unit tests for the dashboard since they don't appear to be connected to ctest (as they probably should be).

if data and len(data) > 1:
return (data[-1][1] - data[-2][1]) / float(data[-1][0] - data[-2][0])
else:
return 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_get_rate looks very similar to some existing functions:

  • mgr.dashboard.controllers.cephfs.CephFS#get_rate
  • mgr.dashboard.controllers.osd.Osd#get_rate
  • mgr.dashboard.controllers.perf_counters.PerfCounter#_get_rate

Maybe, it would make sense to move get_rate to mgr.dashboard.services.ceph_service.CephService refactor the other occurrences?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please feel free to tackle that -- they used to all share the same function and during the refactor they all moved to duplicate implementations. I don't really have the bandwidth.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dillaman sure, that refactor should be done in a different PR by us. thanks

@sebastian-philipp
Copy link
Contributor

@dillaman our unit tests are executed by ctest.

@dillaman
Copy link
Author

@sebastian-philipp What's the name of the test? I don't see a add_ceph_XYZ_test directive in the CMakeFile

@dillaman
Copy link
Author

... never mind, I see your link now. it's just outside the test directory.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Copy link
Contributor

@rjfd rjfd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks for this fix

@dillaman dillaman merged commit 9659826 into ceph:master Mar 16, 2018
@dillaman dillaman deleted the wip-dashboard-iscsi branch March 16, 2018 13:19
@dillaman
Copy link
Author

@rjfd Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants