mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-19 03:10:22 -07:00
interfaces_file - fixed dup options bug (#3862)
* interfaces_file - fixed dup options bug * added changelog fragment
This commit is contained in:
parent
fb79c2998e
commit
3dd5b0d343
4 changed files with 40 additions and 1 deletions
|
@ -253,7 +253,7 @@ def set_interface_option(module, lines, iface, option, raw_value, state, address
|
|||
last_line_dict = iface_lines[-1]
|
||||
return add_option_after_line(option, value, iface, lines, last_line_dict, iface_options, address_family)
|
||||
|
||||
if option in ["pre-up", "up", "down", "post-up"] and all(ito for ito in target_options if ito['value'] != value):
|
||||
if option in ["pre-up", "up", "down", "post-up"] and all(ito['value'] != value for ito in target_options):
|
||||
return add_option_after_line(option, value, iface, lines, target_options[-1], iface_options, address_family)
|
||||
|
||||
# if more than one option found edit the last one
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue