aboutsummaryrefslogtreecommitdiffstats
path: root/src/resource_inventory/models.py
diff options
context:
space:
mode:
authorBrandon Lo <lobrandon1217@gmail.com>2020-01-30 13:35:34 -0500
committerBrandon Lo <lobrandon1217@gmail.com>2020-01-30 13:35:34 -0500
commit4bfa2fa78c487bd8a0453de847ffcb27af526425 (patch)
tree18e1fe2a24a957cb8b45ad99320b2d4a045d4c6b /src/resource_inventory/models.py
parent899e1a4baa95d0bc6f0eef34de66f0e257174878 (diff)
Fix booking errors
This implements Host model's "release" method and replaces an instance of Network to PhysicalNetwork. Change-Id: I99b0bedbde2dcd63411cbb1fbf9b4905fc9570b1 Signed-off-by: Brandon Lo <lobrandon1217@gmail.com>
Diffstat (limited to 'src/resource_inventory/models.py')
-rw-r--r--src/resource_inventory/models.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/resource_inventory/models.py b/src/resource_inventory/models.py
index d152698..1e2e547 100644
--- a/src/resource_inventory/models.py
+++ b/src/resource_inventory/models.py
@@ -424,6 +424,10 @@ class Host(Resource):
"ipmi_create": str(ipmi)
}
+ def release(self):
+ self.booked = False
+ self.save()
+
class Interface(models.Model):
id = models.AutoField(primary_key=True)