-
Notifications
You must be signed in to change notification settings - Fork 12
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
Config parsing requires underscores and config section headers #16
Comments
Thankyou. I really need to address this as Tim Serong has also reported to me this issue. |
Much appreciated! Thankfully, both issues are pretty easy to work around. |
I haven’t yet found a way around the [global] section being optional. I am just testing a patch that allows white space in the key names |
The patch has now been merged. |
As far as the global section goes, the only thing I've seen is to catch the exception being thrown and re-try with a pre-pended string. Discussed in the first and second answers to this SO question. It's a little bit of a hack, but not too bad. |
Interestingly, Python issue 22253 discusses the idea of creating an "empty-string" section for "Sectionless" config files instead of raising the exception. There's a patch, but it looks like not much traction with it. |
I just opened a PR #35 to address the issue of allowing a ceph.conf that doesn't have an explicit '[global]' header. I don't love the result (requires an intermediate object), but I honestly couldn't find a cleaner way, either. |
Oh my, yes. Much, much better. Mine worked locally, but I didn't like it. Thank you for taking the time to fix the issue. I'll close my PR. |
Technically, Ceph doesn't require a '[global]' header, but the library (well, Python's ConfigParser) fails if the ceph.conf doesn't have it.
The ceph-cfg also requires underscores in the key names, whereas Ceph allows spaces as word separators (and hyphens, for that matter). So "mon initial members" fails, expecting "mon_initial_members".
The text was updated successfully, but these errors were encountered: