mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Check for Rules before removing. (#28731)
This commit is contained in:
parent
c97f4653be
commit
7b8f113ceb
1 changed files with 4 additions and 2 deletions
|
@ -717,6 +717,7 @@ def create_or_update_elb_listeners(connection, module, elb):
|
||||||
try:
|
try:
|
||||||
listener_to_add['LoadBalancerArn'] = elb['LoadBalancerArn']
|
listener_to_add['LoadBalancerArn'] = elb['LoadBalancerArn']
|
||||||
# Rules is not a valid parameter for create_listener
|
# Rules is not a valid parameter for create_listener
|
||||||
|
if 'Rules' in listener_to_add:
|
||||||
listener_to_add.pop('Rules')
|
listener_to_add.pop('Rules')
|
||||||
response = connection.create_listener(**listener_to_add)
|
response = connection.create_listener(**listener_to_add)
|
||||||
# Add the new listener
|
# Add the new listener
|
||||||
|
@ -729,6 +730,7 @@ def create_or_update_elb_listeners(connection, module, elb):
|
||||||
for listener_to_modify in listeners_to_modify:
|
for listener_to_modify in listeners_to_modify:
|
||||||
try:
|
try:
|
||||||
# Rules is not a valid parameter for modify_listener
|
# Rules is not a valid parameter for modify_listener
|
||||||
|
if 'Rules' in listener_to_modify:
|
||||||
listener_to_modify.pop('Rules')
|
listener_to_modify.pop('Rules')
|
||||||
connection.modify_listener(**listener_to_modify)
|
connection.modify_listener(**listener_to_modify)
|
||||||
listener_changed = True
|
listener_changed = True
|
||||||
|
|
Loading…
Reference in a new issue