Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ios_lldp_global enable to enabled raised in issue 61554 #62420

Merged
merged 1 commit into from
Sep 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def __init__(self, **kwargs):

argument_spec = {'config': {'options': {'holdtime': {'type': 'int'},
'reinit': {'type': 'int'},
'enable': {'type': 'bool'},
'enabled': {'type': 'bool'},
'timer': {'type': 'int'},
'tlv_select': {
'options': {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,15 +190,15 @@ def _set_config(self, want, have):
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')

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:
Expand All @@ -223,7 +223,7 @@ def _clear_config(self, have):
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'):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def render_config(self, spec, conf):
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:
Expand Down
4 changes: 2 additions & 2 deletions lib/ansible/modules/network/ios/ios_lldp_global.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
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
Expand Down Expand Up @@ -150,7 +150,7 @@
ios_lldp_global:
config:
holdtime: 10
run: True
enabled: True
reinit: 3
timer: 10
state: merged
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
ios_lldp_global: &merged
config:
holdtime: 10
enable: True
enabled: True
reinit: 3
timer: 20
state: merged
Expand Down
6 changes: 3 additions & 3 deletions test/integration/targets/ios_lldp_global/vars/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -36,7 +36,7 @@ deleted:
timer: 100
holdtime: 10
reinit: 3
enable: True
enabled: True

commands:
- "no lldp holdtime"
Expand Down