aboutsummaryrefslogtreecommitdiffstats
path: root/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
commitfec940b7b8d15099b8f914ce35552c59db9eb77b (patch)
treed65e8f7d67957719c84400e9cbbc0007ce215e20 /src/api
parent01ef094c8248d9dfd2807142ea8e78da71413c8b (diff)
parent9693b9e4185f5dfc658655aef0156f36453133ee (diff)
Merge "Fixes the idf and pdf templates so that we can deploy opnfv"
Diffstat (limited to 'src/api')
-rw-r--r--src/api/models.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/api/models.py b/src/api/models.py
index f8b8f89..4ce8c3e 100644
--- a/src/api/models.py
+++ b/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