intel / virtual-storage-manager

Other
162 stars 100 forks source link

Change config parser to use python ConfigParser. #540

Closed jcalcote closed 8 years ago

jcalcote commented 8 years ago

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.

jcalcote commented 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

jcalcote commented 8 years ago

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

jcalcote commented 8 years ago

While continuing work on cfg parser, I noticed these places in scheduler and api that were broken due to config parser changes.

jcalcote commented 8 years ago

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.