summaryrefslogtreecommitdiffstats
path: root/ipalib/__init__.py
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2014-06-06 14:21:16 +0200
committerMartin Kosek <mkosek@redhat.com>2014-06-13 14:15:06 +0200
commitba53299b98977308966039fad9518c79296bccbf (patch)
treed910c0cd399befe91f2f12889a79a4a1ca2501b0 /ipalib/__init__.py
parent91d3d4d7b2abf6441f8be033323d3849bbb57217 (diff)
downloadfreeipa-ba53299b98977308966039fad9518c79296bccbf.tar.gz
freeipa-ba53299b98977308966039fad9518c79296bccbf.tar.xz
freeipa-ba53299b98977308966039fad9518c79296bccbf.zip
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. It also adds the check to commands that override run() but not __call__, such as `ipa ping`, and to commands run on the server. Adjust tests for these changes. https://fedorahosted.org/freeipa/ticket/3963 Reviewed-By: Martin Kosek <mkosek@redhat.com>
Diffstat (limited to 'ipalib/__init__.py')
-rw-r--r--ipalib/__init__.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/ipalib/__init__.py b/ipalib/__init__.py
index 6895b46d4..6b1ec573a 100644
--- a/ipalib/__init__.py
+++ b/ipalib/__init__.py
@@ -140,7 +140,7 @@ implement a ``run()`` method, like this:
>>> api = create_api()
>>> api.register(my_command)
>>> api.finalize()
->>> api.Command.my_command() # Call your command
+>>> api.Command.my_command(version=u'2.47') # Call your command
{'result': 'My run() method was called!'}
When `frontend.Command.__call__()` is called, it first validates any arguments
@@ -359,7 +359,7 @@ False
And yet we can call ``my_command()``:
->>> api.Command.my_command()
+>>> api.Command.my_command(version=u'2.47')
{'result': 'Just my_command.forward() getting called here.'}