aboutsummaryrefslogtreecommitdiffstats
path: root/src/booking
diff options
context:
space:
mode:
authorSawyer Bergeron <sbergeron@iol.unh.edu>2021-10-07 17:14:01 -0400
committerSawyer Bergeron <sbergeron@iol.unh.edu>2021-10-07 17:14:01 -0400
commit5ce0a52b17e530436c298e1b581d37bac853f5a7 (patch)
tree28c1c83bba8e898b099f8abfe9d5d517a5326197 /src/booking
parent5b70b8f1b8bbbe6aeec43b8d8dfdc6b7cc68bc9c (diff)
Manually merge CI files
Signed-off-by: Sawyer Bergeron <sbergeron@iol.unh.edu> Change-Id: Ic63d5da699578007ef2f2cc373350ded06c66971
Diffstat (limited to 'src/booking')
-rw-r--r--src/booking/quick_deployer.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/booking/quick_deployer.py b/src/booking/quick_deployer.py
index 2ab18a6..261b095 100644
--- a/src/booking/quick_deployer.py
+++ b/src/booking/quick_deployer.py
@@ -219,6 +219,12 @@ def create_from_form(form, request):
global_cloud_config = None if not form.cleaned_data['global_cloud_config'] else form.cleaned_data['global_cloud_config']
if global_cloud_config:
+ try:
+ d = yaml.load(global_cloud_config)
+ if not (type(d) is dict):
+ raise Exception("CI file was valid yaml but was not a dict")
+ except Exception as e:
+ raise ValidationError("The provided Cloud Config is not valid yaml, please refer to the Cloud Init documentation for expected structure")
print("about to create global cloud config")
global_cloud_config = CloudInitFile.create(text=global_cloud_config, priority=CloudInitFile.objects.count())
print("made global cloud config")