On 06/09/2014 12:22 PM, Petr Viktorin wrote:
Hello,
This fixes https://fedorahosted.org/freeipa/ticket/3963 for master. I'll
make a slightly less invasive patch for 3.x.

Basically, the version argument is now expected for all commands
(including e.g. ping & env), and also when calling the commands in_server.
If it's not given, a message is returned, so this should should only
really affect tests that check the output strictly.


For the 3.x maintenance branches, here's a much smaller fix. This only checks the version if it was given.

--
PetrĀ³

From 121dfa9226c176d4dfd83b50bf306dbb9db74119 Mon Sep 17 00:00:00 2001
From: Petr Viktorin <pvikt...@redhat.com>
Date: Fri, 6 Jun 2014 14:21:16 +0200
Subject: [PATCH] ipalib.frontend: Do API version check before converting
 arguments

This results in the proper message being shown if the client sends
an option the server doesn't have yet.

https://fedorahosted.org/freeipa/ticket/3963
---
 ipalib/frontend.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/ipalib/frontend.py b/ipalib/frontend.py
index f478ef098029c0f16d1af0498ffad7c3ad59f8bf..a4759534b2f7a4f2c1d826e2395ddfdfcb48c5ec 100644
--- a/ipalib/frontend.py
+++ b/ipalib/frontend.py
@@ -419,6 +419,9 @@ def __call__(self, *args, **options):
         XML-RPC and the executed an the nearest IPA server.
         """
         self.ensure_finalized()
+        version_provided = 'version' in options
+        if version_provided:
+            self.verify_client_version(unicode(options['version']))
         params = self.args_options_2_params(*args, **options)
         self.debug(
             'raw: %s(%s)', self.name, ', '.join(self._repr_iter(**params))
-- 
1.9.0

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to