From 706f3f97ea9235c5a695a69d11685417580221b1 Mon Sep 17 00:00:00 2001 From: Rebeccah Date: Mon, 26 Jul 2021 15:48:26 -0400 Subject: [PATCH] add a new field to the instance model for use with receptor changes (incoming) --- awx/api/serializers.py | 1 + .../migrations/0152_instance_node_type.py | 22 +++++++++++++++++++ awx/main/models/ha.py | 2 ++ 3 files changed, 25 insertions(+) create mode 100644 awx/main/migrations/0152_instance_node_type.py diff --git a/awx/api/serializers.py b/awx/api/serializers.py index 693faa3cbc..174ac60f60 100644 --- a/awx/api/serializers.py +++ b/awx/api/serializers.py @@ -4799,6 +4799,7 @@ class InstanceSerializer(BaseSerializer): "mem_capacity", "enabled", "managed_by_policy", + "node_type", ) def get_related(self, obj): diff --git a/awx/main/migrations/0152_instance_node_type.py b/awx/main/migrations/0152_instance_node_type.py new file mode 100644 index 0000000000..1adcb16c9f --- /dev/null +++ b/awx/main/migrations/0152_instance_node_type.py @@ -0,0 +1,22 @@ +# Generated by Django 2.2.20 on 2021-07-26 19:42 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('main', '0151_rename_managed_by_tower'), + ] + + operations = [ + migrations.AddField( + model_name='instance', + name='node_type', + field=models.CharField( + choices=[('control', 'Control plane node'), ('execution', 'Execution plane node'), ('hybrid', 'Controller and execution')], + default='hybrid', + max_length=16, + ), + ), + ] diff --git a/awx/main/models/ha.py b/awx/main/models/ha.py index a132a2ae6c..5f4657b230 100644 --- a/awx/main/models/ha.py +++ b/awx/main/models/ha.py @@ -86,6 +86,8 @@ class Instance(HasPolicyEditsMixin, BaseModel): default=0, editable=False, ) + NODE_TYPE_CHOICES = [("control", "Control plane node"), ("execution", "Execution plane node"), ("hybrid", "Controller and execution")] + node_type = models.CharField(default='hybrid', choices=NODE_TYPE_CHOICES, max_length=16) class Meta: app_label = 'main'