[Freeipa-devel] [PATCH 0291] idviews: Complain if host is already assigned the ID View in idview-apply

Tomas Babej tbabej at redhat.com
Fri Dec 12 15:15:14 UTC 2014


On 12/12/2014 02:19 PM, Petr Vobornik wrote:
> On 12/11/2014 03:43 PM, Tomas Babej wrote:
>>
>> On 12/11/2014 11:07 AM, Jan Cholasta wrote:
>>> Hi,
>>>
>>> Dne 11.12.2014 v 09:23 Tomas Babej napsal(a):
>>>> Hi,
>>>>
>>>> When running a idview-apply command, the hosts that were already
>>>> assigned
>>>> the desired view were silently ignored. Make sure such hosts show
>>>> up in
>>>> the list of failed hosts.
>>>>
>>>> https://fedorahosted.org/freeipa/ticket/4743
>>>
>>> Shouldn't the error message strings be translatable?
>>>
>>
>> Sure, why not. Good point, I transformed the other error message string
>> as well.
>>
>> Updated patch attach.
>>
>>> Honza
>>>
>
> Got JSON serialization issues for both "ID View already applied" and
> "not found" errors.
>
> Traceback (most recent call last):
>   File "/usr/lib/python2.7/site-packages/ipaserver/rpcserver.py", line
> 402, in __call__
>     response = self.wsgi_execute(environ)
>   File "/usr/lib/python2.7/site-packages/ipaserver/rpcserver.py", line
> 387, in wsgi_execute
>     return self.marshal(result, error, _id, version)
>   File "/usr/lib/python2.7/site-packages/ipaserver/rpcserver.py", line
> 467, in marshal
>     return json.dumps(response, sort_keys=True, indent=4)
>   File "/usr/lib64/python2.7/json/__init__.py", line 250, in dumps
>     sort_keys=sort_keys, **kw).encode(obj)
>   File "/usr/lib64/python2.7/json/encoder.py", line 209, in encode
>     chunks = list(chunks)
>   File "/usr/lib64/python2.7/json/encoder.py", line 434, in _iterencode
>     for chunk in _iterencode_dict(o, _current_indent_level):
>   File "/usr/lib64/python2.7/json/encoder.py", line 408, in
> _iterencode_dict
>     for chunk in chunks:
>   File "/usr/lib64/python2.7/json/encoder.py", line 408, in
> _iterencode_dict
>     for chunk in chunks:
>   File "/usr/lib64/python2.7/json/encoder.py", line 408, in
> _iterencode_dict
>     for chunk in chunks:
>   File "/usr/lib64/python2.7/json/encoder.py", line 408, in
> _iterencode_dict
>     for chunk in chunks:
>   File "/usr/lib64/python2.7/json/encoder.py", line 332, in
> _iterencode_list
>     for chunk in chunks:
>   File "/usr/lib64/python2.7/json/encoder.py", line 332, in
> _iterencode_list
>     for chunk in chunks:
>   File "/usr/lib64/python2.7/json/encoder.py", line 442, in _iterencode
>     o = _default(o)
>   File "/usr/lib64/python2.7/json/encoder.py", line 184, in default
>     raise TypeError(repr(o) + " is not JSON serializable")
> TypeError: Gettext('ID View already applied', domain='ipa',
> localedir=None) is not JSON serializable

Thanks, fixed. Updated patch attached.

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-tbabej-0291-3-idviews-Complain-if-host-is-already-assigned-the-ID-.patch
Type: text/x-patch
Size: 2065 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20141212/38f73bc6/attachment.bin>


More information about the Freeipa-devel mailing list