Fix single app deploy not using config_yaml
[osm/N2VC.git] / juju / client / facade.py
index c4834ee..817b37b 100644 (file)
@@ -200,8 +200,9 @@ class {}(Type):
 {}
         '''""".format(
             name,
-            args.PyToSchemaMapping(),
-            args.SchemaToPyMapping(),
+            # pprint these to get stable ordering across regens
+            pprint.pformat(args.PyToSchemaMapping(), width=999),
+            pprint.pformat(args.SchemaToPyMapping(), width=999),
             ", " if args else "",
             args.as_kwargs(),
             textwrap.indent(args.get_doc(), INDENT * 2))
@@ -437,6 +438,8 @@ class Type:
 
     @classmethod
     def from_json(cls, data):
+        if isinstance(data, cls):
+            return data
         if isinstance(data, str):
             data = json.loads(data)
         d = {}