Closed jcalcote closed 8 years ago
Yaguang - please don't merge this pull request yet. There may be additional changes required - running some tests now. I'll send another comment when i'm sure it's ok. Thanks, John
Ok Yaguang, please go ahead and take this pull request now. I've found the issue I was concerned about and tested it. The changes work with both changesets on this branch. --John
While continuing work on cfg parser, I noticed these places in scheduler and api that were broken due to config parser changes.
The last change set here factors out the side-effect behaviour of creating a CephConfigParser into ceph driver methods in the agent (since that's where they were exclusively used anyway). This makes it much simpler to decide how to manage syncing the db version of ceph conf to the /etc/ceph directory on agents.
Yaguang - I've tested this code - it works just as the hand-written parser does. My next changeset will clean up the obsolete routines, but that will require modifying calling code, so I wanted to keep that change set separate from this one.
The key to making python's ConfigParser work correctly is using the proper optionxform function - see line 64 - this code uses a lambda that converts to lowercase and replaces internal spaces with underscores for comparison purposes. Thus, option names with spaces and underscores compare properly.