mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
ios_logging: fix idempotence errors (#53109)
* ios_logging: fix the error checking the existence of "host" destinations (IOS 12) In the "have" list, records of type "host" do not contain the key "size", although in the list "want" it is always there. Because of this, the module assumes that the "host" type destinations is not configured and does it again. This does not change the configuration on the device, but is redundant and the status of the task will always be "changed". This patch fixes it. * ios_logging: fixes #53227 * ios_logging: minor changes in string matching
This commit is contained in:
parent
ce9fc9b912
commit
4d407d1781
4 changed files with 84 additions and 1 deletions
|
@ -274,7 +274,7 @@ def map_config_to_obj(module):
|
|||
data = get_config(module, flags=['| include logging'])
|
||||
|
||||
for line in data.split('\n'):
|
||||
match = re.search(r'logging (\S+)', line, re.M)
|
||||
match = re.search(r'^logging (\S+)', line, re.M)
|
||||
if match:
|
||||
if match.group(1) in dest_group:
|
||||
dest = match.group(1)
|
||||
|
@ -291,6 +291,7 @@ def map_config_to_obj(module):
|
|||
obj.append({
|
||||
'dest': dest,
|
||||
'name': match.group(1),
|
||||
'size': parse_size(line, dest),
|
||||
'facility': parse_facility(line, dest),
|
||||
'level': parse_level(line, dest)
|
||||
})
|
||||
|
@ -301,6 +302,7 @@ def map_config_to_obj(module):
|
|||
obj.append({
|
||||
'dest': dest,
|
||||
'name': match.group(1),
|
||||
'size': parse_size(line, dest),
|
||||
'facility': parse_facility(line, dest),
|
||||
'level': parse_level(line, dest)
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue