aboutsummaryrefslogtreecommitdiffstats
path: root/src/resource_inventory/models.py
diff options
context:
space:
mode:
authorParker Berberian <pberberian@iol.unh.edu>2020-03-16 10:10:30 -0400
committerParker Berberian <pberberian@iol.unh.edu>2020-03-17 08:48:26 -0400
commite90f13e0413594d95e50256b1206ffd64217f2da (patch)
tree40895a885bb18fd44aeb342041f4be0a068fe69a /src/resource_inventory/models.py
parentb360e0e417f787e0266268596d630b87e88283d1 (diff)
Quick Deploy Fixes.
Change-Id: I46d410af62e4962d235346ba56472aaacb9d3ff2 Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
Diffstat (limited to 'src/resource_inventory/models.py')
-rw-r--r--src/resource_inventory/models.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/resource_inventory/models.py b/src/resource_inventory/models.py
index d11f71b..7115ece 100644
--- a/src/resource_inventory/models.py
+++ b/src/resource_inventory/models.py
@@ -161,7 +161,7 @@ class ResourceTemplate(models.Model):
lab = models.ForeignKey(Lab, null=True, on_delete=models.SET_NULL, related_name="resourcetemplates")
description = models.CharField(max_length=1000, default="")
public = models.BooleanField(default=False)
- hidden = models.BooleanField(default=False)
+ temporary = models.BooleanField(default=False)
def getConfigs(self):
return list(self.resourceConfigurations.all())
@@ -307,11 +307,12 @@ class Server(Resource):
def get_configuration(self, state):
ipmi = state == ConfigState.NEW
power = "off" if state == ConfigState.CLEAN else "on"
+ image = self.config.image.lab_id if self.config else "unknown"
return {
"id": self.labid,
- "image": self.config.image.lab_id,
- "hostname": self.template.resource.name,
+ "image": image,
+ "hostname": self.name,
"power": power,
"ipmi_create": str(ipmi)
}
@@ -498,7 +499,7 @@ class Interface(models.Model):
profile = models.ForeignKey(InterfaceProfile, on_delete=models.CASCADE)
def __str__(self):
- return self.mac_address + " on host " + str(self.host)
+ return self.mac_address + " on host " + str(self.profile.host.name)
"""