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 6 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'}, argument_spec = {'config': {'options': {'holdtime': {'type': 'int'},
'reinit': {'type': 'int'}, 'reinit': {'type': 'int'},
'enable': {'type': 'bool'}, 'enabled': {'type': 'bool'},
'timer': {'type': 'int'}, 'timer': {'type': 'int'},
'tlv_select': { 'tlv_select': {
'options': { 'options': {

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

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

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

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

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

Loading…
Cancel
Save