mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-23 19:01:26 -07:00
* interfaces_file - fixed dup options bug
* added changelog fragment
(cherry picked from commit 3dd5b0d343
)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
parent
f23f409bd6
commit
b08f0b2f82
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