[Freeipa-devel] [PATCHES 180-182] ipatests: Improvements!

Tomas Babej tbabej at redhat.com
Tue May 6 11:12:12 UTC 2014


On 05/05/2014 06:08 PM, Alexander Bokovoy wrote:
> On Fri, 02 May 2014, Jakub Hrozek wrote:
>> On Wed, Apr 30, 2014 at 03:59:01PM +0200, Tomas Babej wrote:
>>> Hi,
>>>
>>> * patch 180 fixes incorrect hostname usage when connecting to legacy
>>> clients
>>> * patch 181 sets up SSSD in debug_level 7 by default
>>> * patch 182 does the same, but on the legacy clients
>>>
>>> -- 
>>> Tomas Babej
>>> Associate Software Engineer | Red Hat | Identity Management
>>> RHCE | Brno Site | IRC: tbabej | freeipa.org
>>>
>>
>> ACK to the general intent of debug_level by default. Have you considered
>> using the python ConfigAPI sssd has to change the sections rather than
>> running a sed script?
> I agree.
>
> The patchset in current form does work fine for me in the tests.
> However, I'd rather wait for a new revision which incorporates changes
> requested by the Jakub.
>
>

I'm not sure using python ConfigAPI would be a better option here, for one
particular reason - the tests themselves are not run on the machine where
we want to change the config.

Hence we need to enclose everything we want done on the client in the
run_command method.

Moving from sed to using python ConfigAPI would mean moving from:

+    host.run_command(['sed', '-i',
+                      '/debug_level = 7/d',
+                      '/etc/sssd/sssd.conf'
+                     ], raiseonerr=False)
+
+    # Add the debug directive to each section
+    host.run_command(['sed', '-i',
+                      '/\[*\]/ a\debug_level = 7',
+                      '/etc/sssd/sssd.conf'
+                     ], raiseonerr=False)

to creating the python script file of ~10-15 lines on the client and
then running it on
the client itself via:

+ host.run_command(['python', 'set_sssd_debug_level.py'])

Given that, it does not seem that much simpler than using two sed
commands to me.

-- 
Tomas Babej
Associate Software Engineer | Red Hat | Identity Management
RHCE | Brno Site | IRC: tbabej | freeipa.org 




More information about the Freeipa-devel mailing list