Browse Source

[2676] Use dict, not keyword arguments

As it turns out, it is not as flexible as needed (it wouldn't be
possible to pass no arguments, it would not be possible to specify
parameters of name `class` easily, and so on).
Michal 'vorner' Vaner 12 years ago
parent
commit
104a04b32d

+ 1 - 1
src/lib/python/isc/config/ccsession.py

@@ -501,7 +501,7 @@ class ModuleCCSession(ConfigData):
             raise ModuleCCSessionError("CC Session timeout waiting for configuration manager")
             raise ModuleCCSessionError("CC Session timeout waiting for configuration manager")
 
 
     def rpc_call(self, command, group, instance=CC_INSTANCE_WILDCARD,
     def rpc_call(self, command, group, instance=CC_INSTANCE_WILDCARD,
-                 to=CC_TO_WILDCARD, **params):
+                 to=CC_TO_WILDCARD, params=None):
         """
         """
         Create a command with the given name and parameters. Send it to a
         Create a command with the given name and parameters. Send it to a
         recipient, wait for the answer and parse it.
         recipient, wait for the answer and parse it.

+ 4 - 2
src/lib/python/isc/config/tests/ccsession_test.py

@@ -297,8 +297,10 @@ class TestModuleCCSession(unittest.TestCase):
         ]
         ]
         exception = None
         exception = None
         try:
         try:
-            result = mccs.rpc_call("test", "Spec2", param1="Param 1",
-                                   param2="Param 2")
+            result = mccs.rpc_call("test", "Spec2", params={
+                                       "param1": "Param 1",
+                                       "param2": "Param 2"
+                                   })
         except Exception as e:
         except Exception as e:
             # We first want to check the value sent, raise the exception
             # We first want to check the value sent, raise the exception
             # afterwards. So store it for a short while.
             # afterwards. So store it for a short while.