On 26/05/15 13:44, Alexander Bokovoy wrote:
On Tue, 26 May 2015, Jan Cholasta wrote:
I tested 0259.1 (it worked for install and update) but not 0259.2
yet.  0259.2 looks OK though; ACK if tested for install and update.

The new patch has only one additional minor fix for a potential problem that currently does not appear anywhere in install and update (see interdiff below), so I consider the ACK transitive.

-            if instance_name.startswith('dirsrv@'):
+            if instance_name.startswith('dirsrv'):
+ # this is intentional, return the empty string if the instance
+                # name is 'dirsrv'
This one is actually pretty bad. If you only check for dirsrv, then
dirsrv.service would get in it and you'd get instance_name[7:] returning
empty string, not a service name at all:
>>> s='dirsrv.service'
>>> s[:-8]
'dirsrv'
>>> s[:-8][7:]
''

>>> s='dirsrv@foobar.service'
>>> s[:-8]
'dirsrv@foobar'
>>> s[:-8][7:]
'foobar'
>>>
Empty string is expected.
Emptry string means the instance has not been specified, and check will be skipped.

Because 'dirsrv.service' doest not contain instance name, so empty string should be returned.

--
Martin Basti

--
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to