[SSSD] [PATCHES] util: Continue if setlocale fails

Michal Židek mzidek at redhat.com
Wed Oct 21 17:25:50 UTC 2015


On 10/21/2015 07:19 PM, Michal Židek wrote:
> On 10/21/2015 06:40 PM, Pavel Reichl wrote:
>>
>>
>> On 10/21/2015 06:28 PM, Michal Židek wrote:
>>> +
>>> +def test_wrong_LC_ALL(local_domain_only):
>>> +    """
>>> +    Regression test for ticket
>>> +https://fedorahosted.org/sssd/ticket/2785
>>> +
>>> +    """
>>> +    subprocess.call(["sss_useradd", "foo", "-M"])
>>> +    pwd.getpwnam("foo")
>>> +
>>> +    # Change the LC_ALL variable to nonexistent locale
>>> +    oldvalue = os.environ.get("LC_ALL", "")
>>> +    os.environ["LC_ALL"] = "nonexistent_locale"
>>> +
>>> +    # sss_userdel must remove the user despite wrong LC_ALL
>>> +    ret = subprocess.call(["sss_userdel", "foo", "-R"])
>>
>> Please check ret value or use check_call method. Thanks!
>>
>>> +    assert_nonexistent_user("foo")
>>> +    os.environ["LC_LOCAL"] = oldvalue
>>> -- 2.1.0
>>
>> Please run pep8, I think I saw missing line and missing space after #.
>>
>> I haven't tested patches I just noticed this nitpicks.
>>
>> Thanks!
>
> Thank you Pavel, I fixed the nitpicks and
> checked the code with pep8.
>
> New patches are attached.
>
> Michal
>

New patches attached. I had unused constant
in the code,

Michal

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-util-Continue-if-setlocale-fails.patch
Type: text/x-patch
Size: 1570 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20151021/710b5a7b/attachment-0004.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-server_setup-Log-failed-attempt-to-set-locale.patch
Type: text/x-patch
Size: 1196 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20151021/710b5a7b/attachment-0005.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-tests-Run-intgcheck-without-libsemanage.patch
Type: text/x-patch
Size: 771 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20151021/710b5a7b/attachment-0006.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-tests-Regression-test-with-wrong-LC_ALL.patch
Type: text/x-patch
Size: 4311 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20151021/710b5a7b/attachment-0007.bin>


More information about the sssd-devel mailing list