Repository navigation
cephadm: isolate mounts code in methods - #54387
Conversation
The _get_container_mounts_for_type method is only useful for ceph based daemon types. There's no need to call this method in a universal context. Signed-off-by: John Mulligan <[email protected]>
The get_container_mounts method on CephExporter is never called. Remove it. Signed-off-by: John Mulligan <[email protected]>
Move the code in an if-block for ceph daemon types within get_container_mounts to a new method of the Ceph type. The logic is moved to a staticmethod so that it can be reused within the CephExporter type. This can be fixed up in the future, but currently the staticmethod handles both Ceph and CephExporter. Both types gain a get_container_mounts for common usage. Signed-off-by: John Mulligan <[email protected]>
Move the code used to set up mounts for monitoring daemon types to a method on the Monitoring class. Signed-off-by: John Mulligan <[email protected]>
| mounts[ | ||
| data_dir + '/keyring' | ||
| ] = '/etc/ceph/ceph.client.%s.%s.keyring' % ( | ||
| ident.daemon_type, | ||
| ident.daemon_id, | ||
| ) |
There was a problem hiding this comment.
is this a black format thing? I find this particular little block a bit harder to read than the original line (even if it was overly long). If it's what the tool does though I can live with it.
There was a problem hiding this comment.
Yes. It is a bit unnatural. I think a quick fix would be to move data_dir + '/keyring' to the line above via a variable assignment, and then black ought to make the block less weird looking. I can do that here in this PR or later on in a follow up series. Let me know what you prefer
There was a problem hiding this comment.
I don't want to hold off merging this over the formatting, so it can be done in a follow up
|
8 failures
Shouldn't merge PRs affecting the specific failed tests or things related to them, but a number of other PRs in the run should be okay to merge. |
Minor cleanups and a move of inline-logic from the get_container_mounts function for ceph and monitoring daemon types.
This greatly simplifies get_container_mounts and will be used as a basis for future refacotring.
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
opened tracker ticketrefactoringShow available Jenkins commands
jenkins retest this pleasejenkins test classic perfjenkins test crimson perfjenkins test signedjenkins test make checkjenkins test make check arm64jenkins test submodulesjenkins test dashboardjenkins test dashboard cephadmjenkins test apijenkins test docsjenkins render docsjenkins test ceph-volume alljenkins test ceph-volume toxjenkins test windows