Ronald Wimmer via FreeIPA-users wrote:
> On 18.09.20 13:04, Rafael Jeffman via FreeIPA-users wrote:
>> On Thu, Sep 17, 2020 at 9:59 AM Ronald Wimmer via FreeIPA-users
>> <freeipa-users(a)lists.fedorahosted.org
>> <mailto:freeipa-users@lists.fedorahosted.org>> wrote:
>>
>> Anyone using freeipa-python here? When I try to use
>>
>> client.host_mod('myserver.mydomain.at
>> <
http://myserver.mydomain.at>';,
userclass='SomeUserClass')
>>
>> the user class is set correctly on the host above but I do get an
>> Exception:
>>
>> File "./modifyHosts.py", line 34, in <module>
>> client.host_mod('myserver.mydomain.at
>> <
http://myserver.mydomain.at>';,
userclass='SomeUserClass')
>> File
>>
"/usr/local/lib/python3.6/site-packages/python_freeipa/client_meta.py",
>>
>> line 11192, in host_mod
>> return self._request(method, _args, _params)
>> File
>>
"/usr/local/lib/python3.6/site-packages/python_freeipa/client.py",
>> line
>> 335, in _request
>> parse_error(error)
>> File
>>
"/usr/local/lib/python3.6/site-packages/python_freeipa/exceptions.py",
>>
>> line 117, in parse_error
>> raise exception_class(message, code)
>> python_freeipa.exceptions.BadRequest: no modifications to be performed
>>
>>
>> Note, on the last line that the error is "no modifications to be
>> performed". It used to occur to me when I tried to modify an object
>> (in this case a "host'), but all attributes already had the same given
>> values.
> Thanks. Made no difference in my case.
>
> host_find() returns only 100 servers whereas the FreeIPA WebGUI shows 132...
>
> As there seems to be no other good python library the alternative would
> be handling JSON-RPC requests to FreeIPA on my own in a python script?
> Maybe I'll go that way. I just need to iterate over all registered hosts
> and fill the userclass attribute with host-mod.
The default search size limit is 100. The UI may query for keys only and
it sounds like it is disabling the size limit.
I guess the WebGUI limits the search size too. But it shows a total
number of hosts on the hosts page. Can I disable that search limit when
I want to iterate over all existing hosts?
Cheers,
Ronald