mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 10:00:01 -03:30
Fix condition for creating receptor_address
If listener_port is not explicitly defined don't create a receptor_address
This commit is contained in:
parent
24a4242147
commit
73d2c92ae3
@ -5609,10 +5609,10 @@ class InstanceSerializer(BaseSerializer):
|
||||
else:
|
||||
instance = super(InstanceSerializer, self).update(obj, validated_data)
|
||||
|
||||
if 'port' in kwargs and kwargs['port'] is None:
|
||||
# delete the receptor address if the port is None
|
||||
if 'port' in kwargs and not kwargs['port']:
|
||||
# delete the receptor address if the port is expolisitly set to None
|
||||
instance.receptor_addresses.filter(address=instance.hostname).delete()
|
||||
elif kwargs:
|
||||
elif 'port' in kwargs:
|
||||
kwargs['canonical'] = True
|
||||
instance.receptor_addresses.update_or_create(address=instance.hostname, defaults=kwargs)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user