Created
March 6, 2015 12:09
-
-
Save brk3/2e71b4b83fccb7d8baa7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from configobj import ConfigObj | |
config = ConfigObj('/etc/neutron/neutron.conf') | |
for item in config.items(): | |
section_name = item[0] | |
for k,v in item[1].iteritems(): | |
print 'crudini --set /etc/neutron/neutron.conf \\' | |
print " %s \\" % section_name | |
print " %s \\" % k | |
print " ${%s}\n" % k.upper() | |
for item in config.items(): | |
section_name = item[0] | |
if item[1]: | |
print "# [%s]" % section_name | |
for k,v in item[1].iteritems(): | |
print "%s=%s" % (k.upper(), v) | |
print "" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment