Repository navigation
python-common: multi-line for yaml - #68034
Conversation
dbe51ee to
7d349f3
Compare
|
How we did something similar for smb resources: ceph/src/pybind/mgr/smb/resources.py Line 113 in 7bc07a9 |
7d349f3 to
cd1c448
Compare
|
jenkins test make check arm64 |
There was a problem hiding this comment.
Thanks for fixing the formatting, however you now have a new word-choice problem. Typically, classes are named using Nouns and (optionally) Adjectives ("Cache", "FastArray", "SocketStreamer", things like that). AsLiteral does not fit this mold. Something like Literal fits that pattern better, but maybe that's too vague - BlockLiteral?
Also, while I'm not opposed to some level of duplication in the code I would like to have @rkachach or perhaps @adk3798 chime in on the duplication of the class we already created for smb module. Perhaps we should create a common implementation? These classes largely do the same thing after all... but I won't insist on it either.
@phlogistonjohn since this new support is being add in a common place, once available we can adjust samba code to make use of it. Wdyt? |
Currently when running the command ceph orch ls --export multi-line strings are processed using default interpretation meaning they could be printed with quotations instead of the expected | . This causes a hassle for users who want to copy their specifications to new yaml files as they have to manually modify the yaml to remove the quotes and add | . My code fixes this by modifying the yaml representer to check for multi-line strings and wrapping them in a YamlLiteralString class which will mark the multi-line string to be processed with | . I've also added unit tests. Signed-off-by: Timothy Q Nguyen <[email protected]>
cd1c448 to
0a73f68
Compare
|
jenkins test make check |
|
|
@phlogistonjohn @rkachach I think it might be better to keep the classes separate since as John mentioned the implementations differ in the 80 chars condition. I'm not completely sure, but I think that condition could harm the service spec yaml export, since this fix is to allow users to export current specs and reapply them, the formatting is strict. |
|
@timqn22 I've been discussing with @phlogistonjohn offline about how to proceed. We agreed that we can proceed with your changes without modifications and do some refactoring later to put this code in a common place so can be reused easily. |
phlogistonjohn
left a comment
There was a problem hiding this comment.
As discussed - this is good enough for now.
|
Teuthology run didn't show any issues that could be related to this PR: Most of the failures are related to NFS and Upgrade. |
Currently when running the command ceph orch ls --export multi-line strings are processed using default interpretation meaning they could be printed with quotations instead of the expected | . This causes a hassle for users who want to copy their specifications to new yaml files as they have to manually modify the yaml to remove the quotes and add | . My code fixes this by modifying the yaml representer to check for multi-line strings and wrapping them in a as_block class which will mark the multi-line string to be processed with | .
Fixes: https://tracker.ceph.com/issues/75743
Signed-off-by: Timothy Q Nguyen [email protected]
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
Show available Jenkins commands
jenkins test classic perfJenkins Job | Jenkins Job Definitionjenkins test crimson perfJenkins Job | Jenkins Job Definitionjenkins test signedJenkins Job | Jenkins Job Definitionjenkins test make checkJenkins Job | Jenkins Job Definitionjenkins test make check arm64Jenkins Job | Jenkins Job Definitionjenkins test submodulesJenkins Job | Jenkins Job Definitionjenkins test dashboardJenkins Job | Jenkins Job Definitionjenkins test dashboard cephadmJenkins Job | Jenkins Job Definitionjenkins test apiJenkins Job | Jenkins Job Definitionjenkins test docsReadTheDocs | Github Workflow Definitionjenkins test ceph-volume allJenkins Jobs | Jenkins Jobs Definitionjenkins test windowsJenkins Job | Jenkins Job Definitionjenkins test rook e2eJenkins Job | Jenkins Job DefinitionYou must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.