Merge lp://staging/~tealeg/landscape-client/use-configobj into lp://staging/~landscape/landscape-client/trunk
Proposed by
Geoff Teale
Status: | Merged |
---|---|
Approved by: | Geoff Teale |
Approved revision: | 729 |
Merged at revision: | 723 |
Proposed branch: | lp://staging/~tealeg/landscape-client/use-configobj |
Merge into: | lp://staging/~landscape/landscape-client/trunk |
Diff against target: |
351 lines (+110/-37) 7 files modified
debian/control (+1/-0) landscape/broker/tests/test_server.py (+5/-1) landscape/configuration.py (+11/-8) landscape/deployment.py (+42/-16) landscape/tests/test_configuration.py (+11/-4) landscape/tests/test_deployment.py (+37/-0) landscape/ui/model/configuration/tests/test_mechanism.py (+3/-8) |
To merge this branch: | bzr merge lp://staging/~tealeg/landscape-client/use-configobj |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Chris Glass (community) | Approve | ||
Free Ekanayaka (community) | Approve | ||
Review via email:
|
Commit message
This branch does a minimal conversion of the landscape-client config
system to use ConfigObj instead of ConfigParser, which fixes the issue
of trashing any comments in the configuration file when we make
updates to it (ConfigParser simply ignores comments at read time, and
is not capable of writing them).
Description of the change
This branch does a minimal conversion of the landscape-client config system to use ConfigObj instead of ConfigParser, which fixes the issue of trashing any comments in the configuration file when we make updates to it (ConfigParser simply ignores comments at read time, and is not capable of writing them).
To post a comment you must log in.
Looks good! +1
[1]
+from configobj import ConfigObj
We need to add a Depends entry for this in debian/control (and check that it's available and on all supported releases).
[2]
+ def get_config_ object( self, config_ source= None):
Please add a docstring and make this private, since it's not meant to be used by calling code.
[3]
+ if config_source: config_ source) self.get_ config_ filename( ))
+ config_obj = ConfigObj(
+ else:
+ config_obj = ConfigObj(
Please prefer removing code duplication when instantiating objects, e.g.:
filename = config_source or self.get_ config_ filename( )
config_obj = ConfigObj(filename)
or:
if config_source is not None: config_ filename( )
filename = config_source
else:
filename = self.get_
config_obj = ConfigObj(filename)