summaryrefslogtreecommitdiffstats
path: root/dashboard/src/api
diff options
context:
space:
mode:
authorParker Berberian <pberberian@iol.unh.edu>2019-04-17 14:32:03 +0000
committerGerrit Code Review <gerrit@opnfv.org>2019-04-17 14:32:03 +0000
commitd26781393ba3827b698e89573ace06ace4240f95 (patch)
tree2830b36b0557fdffa614ae8a4552a8539a779e4e /dashboard/src/api
parent493d0e98ec85e6e91503fdd1b51c918bf74708e0 (diff)
parent1aad8a8ad965b9a20224b2ae094ce776c992a601 (diff)
Merge "Fixes the idf and pdf templates so that we can deploy opnfv"
Diffstat (limited to 'dashboard/src/api')
-rw-r--r--dashboard/src/api/models.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/dashboard/src/api/models.py b/dashboard/src/api/models.py
index f8b8f89..4ce8c3e 100644
--- a/dashboard/src/api/models.py
+++ b/dashboard/src/api/models.py
@@ -25,6 +25,8 @@ from resource_inventory.models import (
Interface,
RemoteInfo
)
+from resource_inventory.idf_templater import IDFTemplater
+from resource_inventory.pdf_templater import PDFTemplater
class JobStatus(object):
@@ -86,8 +88,15 @@ class LabManager(object):
remote_info.save()
host.remote_management = remote_info
host.save()
+ booking = Booking.objects.get(resource=host.bundle)
+ self.update_xdf(booking)
return {"status": "success"}
+ def update_xdf(self, booking):
+ booking.pdf = PDFTemplater.makePDF(booking.resource)
+ booking.idf = IDFTemplater().makeIDF(booking)
+ booking.save()
+
def get_profile(self):
prof = {}
prof['name'] = self.lab.name