diff options
author | Parker Berberian <pberberian@iol.unh.edu> | 2019-02-27 11:52:21 -0500 |
---|---|---|
committer | Parker Berberian <pberberian@iol.unh.edu> | 2019-02-27 11:52:21 -0500 |
commit | c04dcca919cc89d04daa73d570a42134829a91d8 (patch) | |
tree | b9f64047a03f0efbfa56bafec334afedf137cfb9 /src/resource_inventory | |
parent | e858a658aa9594949ec3b357253b34c7489d623d (diff) |
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 <pberberian@iol.unh.edu>
Diffstat (limited to 'src/resource_inventory')
-rw-r--r-- | src/resource_inventory/models.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/resource_inventory/models.py b/src/resource_inventory/models.py index ebf63cc..5f7f3d3 100644 --- a/src/resource_inventory/models.py +++ b/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 |