[Freeipa-devel] [PATCH 0058] Add the otptoken-add-yubikey command

Petr Viktorin pviktori at redhat.com
Mon Jun 23 08:00:34 UTC 2014


On 06/23/2014 09:29 AM, Alexander Bokovoy wrote:
> On Fri, 20 Jun 2014, Nathaniel McCallum wrote:

>> 3. This code currently emits a warning from the call to otptoken-add:
>> WARNING: API Version number was not sent, forward compatibility not
>> guaranteed. Assuming server's API version, 2.89
>>
>> How do I fix this?
> Do not filter 'version' field in options in execute().

Please hardcode the API version instead of reusing it.
This will be important when otptoken_add_yubikey is put in a separate 
package.

i.e.:
+        answer = self.api.Command.otptoken_add(*args,
+            type=u'hotp',
+            ipatokenotpalgorithm=u'sha1',
+            ipatokenhotpcounter=0,
+            version='2.89',
+            **options)

This way even if otptoken_add changes in the future, the fixed version 
string will trigger behavior compatible with what otptoken_add_yubikey 
expects now.


-- 
Petr³




More information about the Freeipa-devel mailing list