#1721 [RFE] Improve output parameters client validation compatibility
Closed: Duplicate None Opened 12 years ago by mkosek.

When input new optional parameter is added to server API, its still usable with old clients with old API, it just cannot use the new parameter.

However, when a new Output parameter is added (for example summary like in the below example), older clients immediately fails with validation error:

$ ipa sudorule-add-option test2
Sudo Option: foo
ipa: ERROR: non-public: ValueError: 
sudorule_add_option.validate_output(): unexpected keys ['summary'] in 
{'result': {'ipasudoopt': (u'foo',), 'cn': (u'test2',), 
'ipaenabledflag': (u'TRUE',)}, 'summary': u'Added option "foo" to Sudo 
Rule "test2"'}
Traceback (most recent call last):
   File "/usr/lib/python2.7/site-packages/ipalib/backend.py", line 125, 
in execute
     result = self.Command[_name](*args, **options)
   File "/usr/lib/python2.7/site-packages/ipalib/frontend.py", line 443, 
in __call__
     self.validate_output(ret)
   File "/usr/lib/python2.7/site-packages/ipalib/frontend.py", line 895, 
in validate_output
     nice, extra, output)
ValueError: sudorule_add_option.validate_output(): unexpected keys 
['summary'] in {'result': {'ipasudoopt': (u'foo',), 'cn': (u'test2',), 
'ipaenabledflag': (u'TRUE',)}, 'summary': u'Added option "foo" to Sudo 
Rule "test2"'}
ipa: ERROR: an internal error has occurred

Think about changing the validation process so that unexpected keys are ignored and no exception is raised.


Regression testing required.

We agreed this is the wrong approach, #2732 should be done without it.

I think the ticket can be closed as invalid.

Metadata Update from @mkosek:
- Issue assigned to pviktori
- Issue set to the milestone: FreeIPA 3.0 Beta 1

7 years ago

Login to comment on this ticket.

Metadata