Skip to content

Commit

Permalink
fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
KB-perByte committed Nov 1, 2023
1 parent ef3c456 commit bff8b37
Show file tree
Hide file tree
Showing 8 changed files with 345 additions and 335 deletions.
12 changes: 5 additions & 7 deletions plugins/filter/pop_ace.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"""

EXAMPLES = r"""
##Playbook with filter plugin example
## Playbook with filter plugin example
vars:
filter_options:
match_all: true
Expand Down Expand Up @@ -219,7 +219,7 @@
ansible.builtin.debug:
msg: "{{ acls_data | ansible.netcommon.pop_ace(filter_options=filter_options, match_criteria=match_criteria) }}"
##Output
## Output
# PLAY [Filter plugin example pop_ace] ******************************************************************************************************************
# TASK [Remove ace entries from a provided data] ***********************************************************************************************************
Expand Down Expand Up @@ -353,8 +353,8 @@
# afi: ipv6
##Playbook with workflow example
tasks:
## Playbook with workflow example
_tasks:
- name: Gather ACLs config from device existing ACLs config
cisco.ios.ios_acls:
state: gathered
Expand All @@ -379,8 +379,7 @@
state: overridden
config: "{{ clean_acls['clean_acls']['acls'] | from_yaml }}"
##Output
## Output
# PLAYBOOK: pop_ace_example.yml ***********************************************
Expand Down Expand Up @@ -989,7 +988,6 @@
# - ip access-list extended 110
# - no 10 deny icmp 192.0.2.0 0.0.0.255 192.0.3.0 0.0.0.255 traceroute dscp ef ttl eq 10
# - no ip access-list extended test
"""

from ansible.errors import AnsibleFilterError
Expand Down
24 changes: 12 additions & 12 deletions plugins/modules/cli_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
ansible.netcommon.cli_command:
command: commit replace
prompt: This commit will replace or remove the entire running configuration
answer: yes
answer: "yes"
- name: run command expecting user confirmation
ansible.netcommon.cli_command:
Expand All @@ -90,27 +90,27 @@
- name: run config mode command and handle prompt/answer
ansible.netcommon.cli_command:
command: '{{ item }}'
command: "{{ item }}"
prompt:
- Exit with uncommitted changes
- Exit with uncommitted changes
answer: y
loop:
- configure
- set system syslog file test any any
- exit
- configure
- set system syslog file test any any
- exit
- name: multiple prompt, multiple answer (mandatory check for all prompts)
ansible.netcommon.cli_command:
command: copy sftp sftp://user@host//user/test.img
check_all: true
prompt:
- Confirm download operation
- Password
- Do you want to change that to the standby image
- Confirm download operation
- Password
- Do you want to change that to the standby image
answer:
- y
- <password>
- y
- y
- <password>
- y
"""

RETURN = """
Expand Down
4 changes: 2 additions & 2 deletions plugins/modules/cli_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
- name: configure device with config with defaults enabled
ansible.netcommon.cli_config:
config: "{{ lookup('template', 'basic/config.j2') }}"
defaults: yes
defaults: "yes"
- name: Use diff_match
ansible.netcommon.cli_config:
Expand All @@ -190,7 +190,7 @@
- name: configurable backup path
ansible.netcommon.cli_config:
config: "{{ lookup('template', 'basic/config.j2') }}"
backup: yes
backup: "yes"
backup_options:
filename: backup.cfg
dir_path: /home/user
Expand Down
65 changes: 32 additions & 33 deletions plugins/modules/grpc_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,39 +78,38 @@
"""

EXAMPLES = """
- name: Merge static route config
ansible.netcommon.grpc_config:
config:
Cisco-IOS-XR-ip-static-cfg:router-static:
default-vrf:
address-family:
vrfipv4:
vrf-unicast:
vrf-prefixes:
vrf-prefix:
- prefix: "1.2.3.6"
prefix-length: 32
vrf-route:
vrf-next-hop-table:
vrf-next-hop-next-hop-address:
- next-hop-address: "10.0.2.2"
state: merged
- name: Merge bgp config
ansible.netcommon.grpc_config:
config: "{{ lookup('file', 'bgp.json') }}"
state: merged
- name: Find diff
diff: True
ansible.netcommon.grpc_config:
config: "{{ lookup('file', 'bgp_start.yml') }}"
state: merged
- name: Backup running config
ansible.netcommon.grpc_config:
backup: yes
- name: Merge static route config
ansible.netcommon.grpc_config:
config:
Cisco-IOS-XR-ip-static-cfg:router-static:
default-vrf:
address-family:
vrfipv4:
vrf-unicast:
vrf-prefixes:
vrf-prefix:
- prefix: "1.2.3.6"
prefix-length: 32
vrf-route:
vrf-next-hop-table:
vrf-next-hop-next-hop-address:
- next-hop-address: "10.0.2.2"
state: merged
- name: Merge bgp config
ansible.netcommon.grpc_config:
config: "{{ lookup('file', 'bgp.json') }}"
state: merged
- name: Find diff
diff: true
ansible.netcommon.grpc_config:
config: "{{ lookup('file', 'bgp_start.yml') }}"
state: merged
- name: Backup running config
ansible.netcommon.grpc_config:
backup: true
"""

RETURN = """
Expand Down
18 changes: 9 additions & 9 deletions plugins/modules/grpc_get.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@
"""

EXAMPLES = """
- name: Get bgp configuration data
grpc_get:
section:
Cisco-IOS-XR-ip-static-cfg:router-static:
- null
- name: run cli command
grpc_get:
command: 'show version'
display: text
- name: Get bgp configuration data
grpc_get:
section:
Cisco-IOS-XR-ip-static-cfg:router-static:
- null
- name: run cli command
grpc_get:
command: "show version"
display: text
"""

RETURN = """
Expand Down
Loading

0 comments on commit bff8b37

Please sign in to comment.