Merge pull request #12968 from ansible/instance-serializer-defaults

Make sure to include field defaults for Instance node_type and node_state
This commit is contained in:
Jeff Bradberry 2022-09-28 10:53:31 -04:00 committed by GitHub
commit 6b0618b244
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4913,7 +4913,10 @@ class InstanceSerializer(BaseSerializer):
'ip_address',
'listener_port',
)
extra_kwargs = {'node_type': {'initial': 'execution'}, 'node_state': {'initial': 'installed'}}
extra_kwargs = {
'node_type': {'initial': Instance.Types.EXECUTION, 'default': Instance.Types.EXECUTION},
'node_state': {'initial': Instance.States.INSTALLED, 'default': Instance.States.INSTALLED},
}
def get_related(self, obj):
res = super(InstanceSerializer, self).get_related(obj)