Change enable to enabled for junos_interfaces module (#62321)

Fixes #62319

Change `enable` option to `enabled` in junos_interfaces
and junos_lldp_interfaces
data model to be in sync with other network platform
resource modules added in 2.9 version.
This commit is contained in:
Ganesh Nalawade 2019-09-16 12:17:27 +05:30 committed by GitHub
parent 4de3e2b440
commit a9a5f4e40d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 52 additions and 52 deletions

View file

@ -42,7 +42,7 @@ class InterfacesArgs(object):
'full-duplex',
'half-duplex'],
'type': 'str'},
'enable': {'default': True, 'type': 'bool'},
'enabled': {'default': True, 'type': 'bool'},
'hold_time': {'options': {'down': {'type': 'int'},
'up': {'type': 'int'}},
'required_together': [['down', 'up']],

View file

@ -37,7 +37,7 @@ class Lldp_interfacesArgs(object):
pass
argument_spec = {'config': {'elements': 'dict',
'options': {'enable': {'type': 'bool'},
'options': {'enabled': {'type': 'bool'},
'name': {'required': True, 'type': 'str'}},
'type': 'list'},
'state': {'choices': ['merged', 'replaced', 'deleted', 'overridden'],

View file

@ -184,7 +184,7 @@ class Interfaces(ConfigBase):
if config.get('duplex'):
build_child_xml_node(intf, 'link-mode', config['duplex'])
if config.get('enable') is False:
if config.get('enabled') is False:
build_child_xml_node(intf, 'disable')
holdtime = config.get('hold_time')

View file

@ -172,8 +172,8 @@ class Lldp_interfaces(ConfigBase):
if config.get('name'):
build_child_xml_node(lldp_intf_root, 'name', config['name'])
if config.get('enable') is not None:
if config['enable'] is False:
if config.get('enabled') is not None:
if config['enabled'] is False:
build_child_xml_node(lldp_intf_root, 'disable')
else:
build_child_xml_node(lldp_intf_root, 'disable', None, {'delete': 'delete'})

View file

@ -105,7 +105,7 @@ class InterfacesFacts(object):
config['hold_time']['up'] = utils.get_xml_conf_arg(conf, 'hold-time/up')
disable = utils.get_xml_conf_arg(conf, 'disable', data='tag')
if disable:
config['enable'] = False
config['enabled'] = False
else:
config['enable'] = True
config['enabled'] = True
return utils.remove_empties(config)

View file

@ -100,5 +100,5 @@ class Lldp_interfacesFacts(object):
config = deepcopy(spec)
config['name'] = utils.get_xml_conf_arg(conf, 'name')
if utils.get_xml_conf_arg(conf, 'disable', data='tag'):
config['enable'] = False
config['enabled'] = False
return utils.remove_empties(config)

View file

@ -60,11 +60,11 @@ options:
full duplex or in automatic state which negotiates the duplex automatically.
type: str
choices: ['automatic', 'full-duplex', 'half-duplex']
enable:
enabled:
default: True
description:
- Administrative state of the interface.
- Set the value to C(true) to administratively enable the interface or C(false) to disable it.
- Set the value to C(true) to administratively enabled the interface or C(false) to disable it.
type: bool
hold_time:
description:
@ -161,11 +161,11 @@ EXAMPLES = """
config:
- name: ge-0/0/1
description: 'Configured by Ansible-1'
enable: True
enabled: True
mtu: 1800
- name: ge-0/0/2
description: 'Configured by Ansible-2'
enable: False
enabled: False
state: merged
# After state:
@ -208,7 +208,7 @@ EXAMPLES = """
config:
- name: ge-0/0/2
description: 'Configured by Ansible-2'
enable: False
enabled: False
mtu: 2800
- name: ge-0/0/3
description: 'Configured by Ansible-3'
@ -255,7 +255,7 @@ EXAMPLES = """
config:
- name: ge-0/0/2
description: 'Configured by Ansible-2'
enable: False
enabled: False
mtu: 2800
- name: ge-0/0/3
description: 'Configured by Ansible-3'

View file

@ -54,7 +54,7 @@ options:
- Name of the interface LLDP needs to be configured on.
type: str
required: True
enable:
enabled:
description:
- This is a boolean value to control disabling of LLDP on the interface C(name)
type: bool
@ -82,7 +82,7 @@ EXAMPLES = """
config:
- name: ge-0/0/1
- name: ge-0/0/2
enable: False
enabled: False
state: merged
# After state:
@ -112,7 +112,7 @@ EXAMPLES = """
- name: ge-0/0/2
disable: False
- name: ge-0/0/3
enable: False
enabled: False
state: replaced
# After state:
@ -141,7 +141,7 @@ EXAMPLES = """
junos_lldp_interfaces:
config:
- name: ge-0/0/2
enable: False
enabled: False
state: overridden
# After state:

View file

@ -7,7 +7,7 @@
- set_fact:
expected_deleted_output:
- name: fxp0
enable: true
enabled: true
- block:
- name: Configure initial state for interface
@ -17,7 +17,7 @@
description: "Configured by Ansible - Interface 1"
mtu: 1024
speed: 100m
enable: False
enabled: False
duplex: full-duplex
hold_time:
up: 2000

View file

@ -8,12 +8,12 @@
expected_group_output:
- name: ge-0/0/11
description: "within test group"
enable: true
enabled: true
- name: ge-0/0/12
description: "global interface config"
enable: true
enabled: true
- name: fxp0
enable: true
enabled: true
- name: "Teardown delete interface configuration"
junos_config: &delete_interface_config

View file

@ -10,7 +10,7 @@
description: "Configured by Ansible - Interface 1"
mtu: 1024
speed: 100m
enable: false
enabled: false
duplex: full-duplex
hold_time:
up: 2000
@ -19,12 +19,12 @@
description: "Configured by Ansible - Interface 2"
mtu: 2048
speed: 10m
enable: true
enabled: true
hold_time:
up: 3000
down: 3200
- name: fxp0
enable: true
enabled: true
- block:
- name: Merge the provided configuration with the exisiting running configuration
@ -34,7 +34,7 @@
description: "Configured by Ansible - Interface 1"
mtu: 1024
speed: 100m
enable: False
enabled: False
duplex: full-duplex
hold_time:
up: 2000

View file

@ -8,9 +8,9 @@
expected_overridden_output:
- name: ge-0/0/1
description: "Overridden by Ansible - Interface 1"
enable: true
enabled: true
- name: fxp0
enable: true
enabled: true
- block:
- name: Configure initial state for interface
@ -20,7 +20,7 @@
description: "Configured by Ansible - Interface 1"
mtu: 1024
speed: 100m
enable: False
enabled: False
duplex: full-duplex
hold_time:
up: 2000

View file

@ -10,17 +10,17 @@
description: "Replaced by Ansible - Interface 1"
mtu: 2048
speed: 10m
enable: true
enabled: true
- name: ge-0/0/2
description: "Configured by Ansible - Interface 2"
mtu: 2048
speed: 10m
enable: true
enabled: true
hold_time:
up: 3000
down: 3200
- name: fxp0
enable: true
enabled: true
- block:
- name: Configure initial state for interface
@ -30,7 +30,7 @@
description: "Configured by Ansible - Interface 1"
mtu: 1024
speed: 100m
enable: False
enabled: False
duplex: full-duplex
hold_time:
up: 2000
@ -52,7 +52,7 @@
description: "Replaced by Ansible - Interface 1"
mtu: 2048
speed: 10m
enable: True
enabled: True
state: replaced
register: result

View file

@ -10,7 +10,7 @@
description: "Configured by Ansible - Interface 1"
mtu: 1024
speed: 100m
enable: false
enabled: false
duplex: full-duplex
hold_time:
up: 2000
@ -19,12 +19,12 @@
description: "Configured by Ansible - Interface 2"
mtu: 2048
speed: 10m
enable: true
enabled: true
hold_time:
up: 3000
down: 3200
- name: fxp0
enable: true
enabled: true
- block:
- name: Apply the provided configuration (base config)
@ -34,7 +34,7 @@
description: "Configured by Ansible - Interface 1"
mtu: 1024
speed: 100m
enable: False
enabled: False
duplex: full-duplex
hold_time:
up: 2000
@ -43,7 +43,7 @@
description: "Configured by Ansible - Interface 2"
mtu: 2048
speed: 10m
enable: True
enabled: True
hold_time:
up: 3000
down: 3200
@ -64,7 +64,7 @@
description: "Configured by Ansible - Interface 1 modified"
mtu: 3048
speed: 10m
enable: True
enabled: True
duplex: half-duplex
hold_time:
up: 3000
@ -73,7 +73,7 @@
description: "Configured by Ansible - Interface 2 modified"
mtu: 4048
speed: 100m
enable: False
enabled: False
hold_time:
up: 4000
down: 5200

View file

@ -30,7 +30,7 @@
config:
- name: ge-0/0/1
- name: ge-0/0/2
enable: False
enabled: False
state: merged
register: result

View file

@ -25,14 +25,14 @@
expected_merged_output:
- name: ge-0/0/1
- name: ge-0/0/2
enable: False
enabled: False
- name: Merge the provided configuration with the exisiting running configuration
junos_lldp_interfaces: &merged
config:
- name: ge-0/0/1
- name: ge-0/0/2
enable: False
enabled: False
state: merged
register: result

View file

@ -30,7 +30,7 @@
config:
- name: ge-0/0/1
- name: ge-0/0/2
enable: False
enabled: False
state: merged
register: result

View file

@ -24,23 +24,23 @@
- set_fact:
expected_replaced_output:
- name: ge-0/0/1
enable: False
enabled: False
- name: ge-0/0/2
enable: False
enabled: False
- name: Configure initial state for interface
junos_lldp_interfaces:
config:
- name: ge-0/0/1
- name: ge-0/0/2
enable: False
enabled: False
register: result
- name: Replace the provided configuration with the exisiting running configuration
junos_lldp_interfaces: &replaced
config:
- name: ge-0/0/1
enable: False
enabled: False
state: replaced
register: result

View file

@ -25,14 +25,14 @@
expected_revert_output:
- name: ge-0/0/1
- name: ge-0/0/2
enable: False
enabled: False
- name: Apply the provided configuration (base config)
junos_lldp_interfaces:
config:
- name: ge-0/0/1
- name: ge-0/0/2
enable: False
enabled: False
state: merged
register: base_config