From 5b70b8f1b8bbbe6aeec43b8d8dfdc6b7cc68bc9c Mon Sep 17 00:00:00 2001 From: Sawyer Bergeron Date: Thu, 30 Sep 2021 16:33:01 -0400 Subject: Fixes for collaborator field Signed-off-by: Sawyer Bergeron Change-Id: I3dbdedf26fa84617ea7680a0f99e032d88f1ea98 Signed-off-by: Sawyer Bergeron --- src/resource_inventory/models.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/resource_inventory') diff --git a/src/resource_inventory/models.py b/src/resource_inventory/models.py index 941c38f..71046a8 100644 --- a/src/resource_inventory/models.py +++ b/src/resource_inventory/models.py @@ -170,7 +170,8 @@ class CloudInitFile(models.Model): @classmethod def create(cls, text="", priority=0): prepended_text = "#cloud-config\n" - prepended_text = prepended_text + yaml.dump(CloudInitFile.merge_strategy()) + "\n" + mstrat = CloudInitFile.merge_strategy() + prepended_text = prepended_text + yaml.dump({"merge_strategy": mstrat}) + "\n" print("in cloudinitfile create") text = prepended_text + text cloud_dict = { @@ -184,7 +185,7 @@ class CloudInitFile(models.Model): }, "datasource_list": ["None"], } - return CloudInitFile.objects.create(priority=priority, text=json.dumps(cloud_dict)) + return CloudInitFile.objects.create(priority=priority, text=yaml.dump(cloud_dict)) class ResourceTemplate(models.Model): """ -- cgit 1.2.3-korg