aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/dashboard/tasks.py2
-rw-r--r--src/resource_inventory/migrations/0017_auto_20201218_1516.py18
-rw-r--r--src/resource_inventory/models.py2
-rw-r--r--src/resource_inventory/resource_manager.py4
4 files changed, 23 insertions, 3 deletions
diff --git a/src/dashboard/tasks.py b/src/dashboard/tasks.py
index 8554f6c..fec8384 100644
--- a/src/dashboard/tasks.py
+++ b/src/dashboard/tasks.py
@@ -84,7 +84,7 @@ def free_hosts():
resource__isnull=False
)
for booking in bookings:
- ResourceManager.getInstance().deleteResourceBundle(booking.resource)
+ ResourceManager.getInstance().releaseResourceBundle(booking.resource)
@shared_task
diff --git a/src/resource_inventory/migrations/0017_auto_20201218_1516.py b/src/resource_inventory/migrations/0017_auto_20201218_1516.py
new file mode 100644
index 0000000..d4884de
--- /dev/null
+++ b/src/resource_inventory/migrations/0017_auto_20201218_1516.py
@@ -0,0 +1,18 @@
+# Generated by Django 2.2 on 2020-12-18 15:16
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('resource_inventory', '0016_auto_20201109_1947'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='resourceconfiguration',
+ name='name',
+ field=models.CharField(default='opnfv_host', max_length=3000),
+ ),
+ ]
diff --git a/src/resource_inventory/models.py b/src/resource_inventory/models.py
index e2f2fea..7fe479a 100644
--- a/src/resource_inventory/models.py
+++ b/src/resource_inventory/models.py
@@ -233,7 +233,7 @@ class ResourceConfiguration(models.Model):
image = models.ForeignKey("Image", on_delete=models.PROTECT)
template = models.ForeignKey(ResourceTemplate, related_name="resourceConfigurations", null=True, on_delete=models.CASCADE)
is_head_node = models.BooleanField(default=False)
- name = models.CharField(max_length=3000, default="<Hostname>")
+ name = models.CharField(max_length=3000, default="opnfv_host")
def __str__(self):
return str(self.name)
diff --git a/src/resource_inventory/resource_manager.py b/src/resource_inventory/resource_manager.py
index 140cc09..f587a82 100644
--- a/src/resource_inventory/resource_manager.py
+++ b/src/resource_inventory/resource_manager.py
@@ -64,9 +64,11 @@ class ResourceManager:
# public interface
def deleteResourceBundle(self, resourceBundle):
+ raise NotImplementedError("Resource Bundle Deletion Not Implemented")
+
+ def releaseResourceBundle(self, resourceBundle):
for resource in resourceBundle.get_resources():
resource.release()
- resourceBundle.delete()
def get_vlans(self, resourceTemplate):
networks = {}