diff options
author | Parker Berberian <pberberian@iol.unh.edu> | 2019-03-06 11:47:23 -0500 |
---|---|---|
committer | Parker Berberian <pberberian@iol.unh.edu> | 2019-03-06 11:47:23 -0500 |
commit | 36c012ef86233a323434be5e4c6de524188591e9 (patch) | |
tree | 78a42cebef1bb3d3a837863fe2c788475d5f02f8 | |
parent | b5bd056d00d76bac14649aae9e9af7b181e54570 (diff) |
Fix migration and models
We missed a few migrations
Change-Id: I58e1abb53e5295ec6c6228906d6eb2fd7fea0b84
Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
4 files changed, 70 insertions, 2 deletions
diff --git a/src/notifier/migrations/0005_auto_20190306_1616.py b/src/notifier/migrations/0005_auto_20190306_1616.py new file mode 100644 index 0000000..d92c988 --- /dev/null +++ b/src/notifier/migrations/0005_auto_20190306_1616.py @@ -0,0 +1,18 @@ +# Generated by Django 2.1 on 2019-03-06 16:16 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('notifier', '0004_auto_20190124_2115'), + ] + + operations = [ + migrations.AlterField( + model_name='notification', + name='recipients', + field=models.ManyToManyField(related_name='notifications', to='account.UserProfile'), + ), + ] diff --git a/src/resource_inventory/migrations/0007_auto_20190306_1616.py b/src/resource_inventory/migrations/0007_auto_20190306_1616.py new file mode 100644 index 0000000..19a49c5 --- /dev/null +++ b/src/resource_inventory/migrations/0007_auto_20190306_1616.py @@ -0,0 +1,31 @@ +# Generated by Django 2.1 on 2019-03-06 16:16 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('resource_inventory', '0006_auto_20190124_1700'), + ] + + operations = [ + migrations.CreateModel( + name='RemoteInfo', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('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(default='ipmi', max_length=50)), + ('versions', models.CharField(max_length=100)), + ], + ), + migrations.AlterField( + model_name='genericinterface', + name='profile', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='resource_inventory.InterfaceProfile'), + ), + ] diff --git a/src/resource_inventory/migrations/0008_host_remote_management.py b/src/resource_inventory/migrations/0008_host_remote_management.py new file mode 100644 index 0000000..f74a535 --- /dev/null +++ b/src/resource_inventory/migrations/0008_host_remote_management.py @@ -0,0 +1,19 @@ +# Generated by Django 2.1 on 2019-03-06 16:42 + +from django.db import migrations, models +import resource_inventory.models + + +class Migration(migrations.Migration): + + dependencies = [ + ('resource_inventory', '0007_auto_20190306_1616'), + ] + + operations = [ + migrations.AddField( + model_name='host', + name='remote_management', + field=models.ForeignKey(default=resource_inventory.models.get_default_remote_info, on_delete=models.SET(resource_inventory.models.get_default_remote_info), to='resource_inventory.RemoteInfo'), + ), + ] diff --git a/src/resource_inventory/models.py b/src/resource_inventory/models.py index 5f7f3d3..4e3974e 100644 --- a/src/resource_inventory/models.py +++ b/src/resource_inventory/models.py @@ -301,14 +301,14 @@ class RemoteInfo(models.Model): def get_default_remote_info(): - RemoteInfo.objects.get_or_create( + return RemoteInfo.objects.get_or_create( address="default", mac_address="default", password="default", user="default", management_type="default", versions="[default]" - ) + )[0].pk # Concrete host, actual machine in a lab |