Fix ios_lldp_global enable to enabled raised in issue 61554 (#62440)

* fix ios_lldp_global (#62420)


(cherry picked from commit 9addad0f4a)

* changelog
pull/62469/head
Sumit Jaiswal 5 years ago committed by Toshio Kuratomi
parent ec841a086c
commit 51b8daa64d

@ -0,0 +1,3 @@
---
bugfixes:
- "Fix ios_lldp_global enable to enabled(https://github.com/ansible/ansible/pull/62420)"

@ -36,7 +36,7 @@ class Lldp_globalArgs(object):
argument_spec = {'config': {'options': {'holdtime': {'type': 'int'},
'reinit': {'type': 'int'},
'enable': {'type': 'bool'},
'enabled': {'type': 'bool'},
'timer': {'type': 'int'},
'tlv_select': {
'options': {

@ -190,7 +190,7 @@ class Lldp_global(ConfigBase):
if diff:
diff = dict(diff)
holdtime = diff.get('holdtime')
enable = diff.get('enable')
enabled = diff.get('enabled')
timer = diff.get('timer')
reinit = diff.get('reinit')
tlv_select = diff.get('tlv_select')
@ -198,7 +198,7 @@ class Lldp_global(ConfigBase):
if holdtime:
cmd = 'lldp holdtime {0}'.format(holdtime)
self.add_command_to_config_list(cmd, commands)
if enable:
if enabled:
cmd = 'lldp run'
self.add_command_to_config_list(cmd, commands)
if timer:
@ -223,7 +223,7 @@ class Lldp_global(ConfigBase):
if have.get('holdtime'):
cmd = 'lldp holdtime'
self._remove_command_from_config_list(cmd, commands)
if have.get('enable'):
if have.get('enabled'):
cmd = 'lldp run'
self._remove_command_from_config_list(cmd, commands)
if have.get('timer'):

@ -81,7 +81,7 @@ class Lldp_globalFacts(object):
if holdtime:
config['holdtime'] = int(holdtime)
if 'lldp run' in conf:
config['enable'] = True
config['enabled'] = True
if timer:
config['timer'] = int(timer)
if reinit:

@ -69,7 +69,7 @@ options:
For any other reinit value, idempotency will be maintained
since any other reinit value is recorded in the Cisco device.
type: int
enable:
enabled:
description:
- Enable LLDP
type: bool
@ -150,7 +150,7 @@ EXAMPLES = """
ios_lldp_global:
config:
holdtime: 10
run: True
enabled: True
reinit: 3
timer: 10
state: merged

@ -9,7 +9,7 @@
ios_lldp_global: &merged
config:
holdtime: 10
enable: True
enabled: True
reinit: 3
timer: 20
state: merged

@ -12,14 +12,14 @@ merged:
timer: 20
holdtime: 10
reinit: 3
enable: True
enabled: True
replaced:
before:
timer: 100
holdtime: 10
reinit: 3
enable: True
enabled: True
commands:
- "no lldp run"
@ -36,7 +36,7 @@ deleted:
timer: 100
holdtime: 10
reinit: 3
enable: True
enabled: True
commands:
- "no lldp holdtime"

Loading…
Cancel
Save