aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/resource_inventory/migrations/0013_auto_20200218_1536.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/resource_inventory/migrations/0013_auto_20200218_1536.py b/src/resource_inventory/migrations/0013_auto_20200218_1536.py
index 014cb2f..d9dcbd6 100644
--- a/src/resource_inventory/migrations/0013_auto_20200218_1536.py
+++ b/src/resource_inventory/migrations/0013_auto_20200218_1536.py
@@ -25,7 +25,7 @@ def populate_servers(apps, schema_editor):
ResourceProfile = apps.get_model('resource_inventory', 'ResourceProfile')
for h in Host.objects.all():
rp = ResourceProfile.objects.get(id=h.profile.id)
- Server.objects.create(
+ server = Server.objects.create(
working=h.working,
vendor=h.vendor,
labid=h.labid,
@@ -35,6 +35,9 @@ def populate_servers(apps, schema_editor):
profile=rp
)
+ for iface in h.interfaces.all():
+ server.interfaces.add(iface)
+
def populate_resource_templates(apps, schema_editor):
"""