mirror of
https://github.com/ansible-collections/community.routeros.git
synced 2025-06-22 01:49:02 +02:00
Support absent values. Support absent value 'all' for 'server' in /ip dhcp-server lease. (#107)
This commit is contained in:
parent
a2ace3fb79
commit
f797b4a231
7 changed files with 232 additions and 10 deletions
|
@ -275,10 +275,12 @@ def main():
|
|||
if handle_disabled == 'exclamation':
|
||||
k = '!%s' % k
|
||||
entry[k] = None
|
||||
if hide_defaults:
|
||||
for k, field_info in path_info.fields.items():
|
||||
for k, field_info in path_info.fields.items():
|
||||
if hide_defaults:
|
||||
if field_info.default is not None and entry.get(k) == field_info.default:
|
||||
entry.pop(k)
|
||||
if field_info.absent_value and k not in entry:
|
||||
entry[k] = field_info.absent_value
|
||||
result.append(entry)
|
||||
|
||||
module.exit_json(result=result)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue