[Freeipa-devel] [PATCH] 151, 152 Removal of illegal options in association dialog
Petr Vobornik
pvoborni at redhat.com
Wed Jun 6 12:12:53 UTC 2012
On 06/05/2012 08:38 PM, Endi Sukma Dewata wrote:
> If I understood correctly the json_exclude_attrs already defines the
> list of attributes to be excluded, so is it still necessary to define
> json_only_presence_options which basically will remove all attributes
> except name? Suppose later you're writing the UI console where you can
> type the CLI commands in the UI, do you think attributes like doc would
> be needed to show in the command help?
Depends on the implementation :). I think doc, labels and such would be
very useful. In such case the missing attributes might be a problem. But
it can be overcame by supplying it in other way because of the nature of
the options in only_presences list (their attrs are same everywhere).
Ideally I would not use the json_only_presence_options but it saves
quite a lot of data.
Btw, regarding the response size: if indentation in json.dump is
disabled it save about 3/4 of the size - very handy. I don't want to do
it yet because the ouput is not very readable (for devels). I think
enabling gzip compression for /ipa/session/json might be a way too.
>
> If this is fine then ACK on both.
I'm not sure if my reasoning can be considered 'fine'.
>
> Btw, the static test data (i.e. ipa_init_*.json) should be updated as
> well. You might want to create some scripts in install/ui/test/bin to
> update these files similar to update_ipa_init.sh.
Ah, I forget to update it. I have a script which can handle both. I'll
include updated ipa_init_object.json and ipa_init_command.json when
pushing #152.
I'm attaching the script, if you are interested. It works with
form-based auth, so I can query test machine from devel machine without
test's krb5.conf. I'm using the script for generating other .json files.
I haven't put to git because of my frequent personal changes which might
not be useful for others.
>
>
> On 6/4/2012 11:05 AM, Petr Vobornik wrote:
>> [PATCH] 152 Removal of illegal options in association dialog:
>>
>> Association dialogs were using non-existent options for find commands.
>> It causes error when #2509 is implemented.
>>
>> Now when creating a find command a check for options existence is
>> performed. Option is not used if not present in metadata. It fixes the
>> issue.
>>
>> To be able to do the this check properly patch 151 is required.
>>
>> [PATCH] 151 Change json serialization to serialize useful data:
>>
>> json_metadata command creates and sends metadata needed by Web UI. It
>> uses __json__ method for serialization of commands, options, objects...
>> . A lot of data sent was useless for Web UI and some usefull information
>> were missing. We
>> * mostly CLI specific option attribues are not send.
>> * attributes evaluated to false or None are not send
>> * options which are send are not got from takes_aptions attribute but by
>> get_options() method. It finally sends usefull option collection for
>> commands part of metadata.
>>
>> In the end the raw amount of data send is aproximately the same.
>>
>> This patch is needed for Web UI to determine which option it can use in
>> which commands.
>>
>> https://fedorahosted.org/freeipa/ticket/2760
>
>
--
Petr Vobornik
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ipa-json.py
Type: text/x-python
Size: 17822 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20120606/de5e4d2c/attachment.py>
More information about the Freeipa-devel
mailing list