diff options
author | Parker Berberian <pberberian@iol.unh.edu> | 2020-04-14 18:15:55 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2020-04-14 18:15:55 +0000 |
commit | 6bf37e9864787e0398a1d2e1cdd10b40a8ebc6e6 (patch) | |
tree | 18396967cc32110ae5455827e612e2846e55392c /src/resource_inventory/models.py | |
parent | d5b4f4c77534824430fd8e2d3f15e5f7ed6303f5 (diff) | |
parent | 557659acfd97ddaacdb89192ff6a575691b39093 (diff) |
Merge "Add user + user list to API"
Diffstat (limited to 'src/resource_inventory/models.py')
-rw-r--r-- | src/resource_inventory/models.py | 9 |
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) """ |