Fixed name conflict in auto-generated code
authorCory Johns <johnsca@gmail.com>
Tue, 8 Nov 2016 16:53:01 +0000 (11:53 -0500)
committerCory Johns <johnsca@gmail.com>
Tue, 8 Nov 2016 16:53:01 +0000 (11:53 -0500)
juju/client/facade.py

index be5f23b..c4834ee 100644 (file)
@@ -344,9 +344,9 @@ def makeFunc(cls, name, params, result, async=True):
     assignments = []
     toschema = args.PyToSchemaMapping()
     for arg in args._get_arg_str(False, False):
-        assignments.append("{}params[\'{}\'] = {}".format(INDENT,
-                                                          toschema[arg],
-                                                          arg))
+        assignments.append("{}_params[\'{}\'] = {}".format(INDENT,
+                                                           toschema[arg],
+                                                           arg))
     assignments = "\n".join(assignments)
     res = retspec(result)
     source = """
@@ -358,8 +358,8 @@ def makeFunc(cls, name, params, result, async=True):
     Returns -> {res}
     '''
     # map input types to rpc msg
-    params = dict()
-    msg = dict(type='{cls.name}', request='{name}', version={cls.version}, params=params)
+    _params = dict()
+    msg = dict(type='{cls.name}', request='{name}', version={cls.version}, params=_params)
 {assignments}
     reply = {await}self.rpc(msg)
     return reply