From d83ca3f27dda6c5bf1f1475ab66a676f60a19a11 Mon Sep 17 00:00:00 2001 From: Parker Berberian Date: Wed, 27 Feb 2019 11:52:21 -0500 Subject: Update IPMI handling provides a way for the lab to report IPMI info to the dashboard. Necessary to allow the dashboard to fully generate a PDF for OPNFV deploy Change-Id: Ieef7a93e28b155ee90f3ffd3cfeedace332a6641 Signed-off-by: Parker Berberian --- dashboard/src/resource_inventory/models.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'dashboard/src/resource_inventory/models.py') diff --git a/dashboard/src/resource_inventory/models.py b/dashboard/src/resource_inventory/models.py index ebf63cc..5f7f3d3 100644 --- a/dashboard/src/resource_inventory/models.py +++ b/dashboard/src/resource_inventory/models.py @@ -291,6 +291,26 @@ class HostConfiguration(models.Model): return "config with " + str(self.host) + " and image " + str(self.image) +class RemoteInfo(models.Model): + address = models.CharField(max_length=15) + mac_address = models.CharField(max_length=17) + password = models.CharField(max_length=100) + user = models.CharField(max_length=100) + management_type = models.CharField(max_length=50, default="ipmi") + versions = models.CharField(max_length=100) # json serialized list of floats + + +def get_default_remote_info(): + RemoteInfo.objects.get_or_create( + address="default", + mac_address="default", + password="default", + user="default", + management_type="default", + versions="[default]" + ) + + # Concrete host, actual machine in a lab class Host(models.Model): id = models.AutoField(primary_key=True) @@ -305,6 +325,7 @@ class Host(models.Model): working = models.BooleanField(default=True) vendor = models.CharField(max_length=100, default="unknown") model = models.CharField(max_length=150, default="unknown") + remote_management = models.ForeignKey(RemoteInfo, default=get_default_remote_info, on_delete=models.SET(get_default_remote_info)) def __str__(self): return self.name -- cgit 1.2.3-korg