diff options
| author | Stanislav Laznicka <slaznick@redhat.com> | 2016-11-03 12:25:55 +0100 |
|---|---|---|
| committer | Jan Cholasta <jcholast@redhat.com> | 2016-11-11 12:13:56 +0100 |
| commit | 990e1acb1a667b90619e7799bb96e2cd81e97e61 (patch) | |
| tree | b7af8847ce14de4230f17aed58f95a2341230ef5 /ipaclient | |
| parent | 0914a3aeb778986dea4020ddf8ca550ebef02bad (diff) | |
| download | freeipa-990e1acb1a667b90619e7799bb96e2cd81e97e61.tar.gz freeipa-990e1acb1a667b90619e7799bb96e2cd81e97e61.tar.xz freeipa-990e1acb1a667b90619e7799bb96e2cd81e97e61.zip | |
Fix to ipachangeconf docstrings
https://fedorahosted.org/freeipa/ticket/6392
Reviewed-By: Martin Basti <mbasti@redhat.com>
Diffstat (limited to 'ipaclient')
| -rw-r--r-- | ipaclient/ipachangeconf.py | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/ipaclient/ipachangeconf.py b/ipaclient/ipachangeconf.py index 08e24e6e4..25473fb49 100644 --- a/ipaclient/ipachangeconf.py +++ b/ipaclient/ipachangeconf.py @@ -395,15 +395,15 @@ class IPAChangeConf(object): raise SyntaxError('Unknown type: [%s]' % no['type']) def merge(self, oldopts, newopts): - - #Use a two pass strategy - #First we create a new opts tree from oldopts removing/commenting - # the options as indicated by the contents of newopts - #Second we fill in the new opts tree with options as indicated - # in the newopts tree (this is becaus eentire (sub)sections may - # in the newopts tree (this is becaus entire (sub)sections may - # exist in the newopts that do not exist in oldopts) - + """ + Uses a two pass strategy: + First we create a new opts tree from oldopts removing/commenting + the options as indicated by the contents of newopts + Second we fill in the new opts tree with options as indicated + in the newopts tree (this is becaus eentire (sub)sections may + in the newopts tree (this is becaus entire (sub)sections may + exist in the newopts that do not exist in oldopts) + """ opts = self.mergeOld(oldopts, newopts) self.mergeNew(opts, newopts) return opts @@ -473,12 +473,14 @@ class IPAChangeConf(object): return opts - # Write settings to configuration file - # file is a path - # options is a set of dictionaries in the form: - # [{'name': 'foo', 'value': 'bar', 'action': 'set/comment'}] - # section is a section name like 'global' def changeConf(self, file, newopts): + """ + Write settings to configuration file + :param file: path to the file + :param options: set of dictionaries in the form: + {'name': 'foo', 'value': 'bar', 'action': 'set/comment'} + :param section: section name like 'global' + """ output = "" f = None try: @@ -506,11 +508,13 @@ class IPAChangeConf(object): pass return True - # Write settings to new file, backup old - # file is a path - # options is a set of dictionaries in the form: - # [{'name': 'foo', 'value': 'bar', 'action': 'set/comment'}] def newConf(self, file, options): + """" + Write settings to a new file, backup the old + :param file: path to the file + :param options: a set of dictionaries in the form: + {'name': 'foo', 'value': 'bar', 'action': 'set/comment'} + """ output = "" f = None try: |
