From f5e37b4069d28b90be79da5b0a12036ae6ce3e33 Mon Sep 17 00:00:00 2001 From: KB-perByte Date: Thu, 26 Oct 2023 16:23:43 +0530 Subject: [PATCH] lint issues --- plugins/modules/ios_acl_interfaces.py | 2 +- plugins/modules/ios_acls.py | 2 +- plugins/modules/ios_banner.py | 2 +- plugins/modules/ios_command.py | 1 - plugins/modules/ios_config.py | 1 - plugins/modules/ios_hostname.py | 2 +- plugins/modules/ios_l3_interfaces.py | 1 - plugins/modules/ios_lacp_interfaces.py | 1 - plugins/modules/ios_lag_interfaces.py | 4 ++-- plugins/modules/ios_linkagg.py | 3 +-- plugins/modules/ios_lldp_global.py | 3 +-- plugins/modules/ios_logging_global.py | 2 +- plugins/modules/ios_ntp.py | 3 ++- plugins/modules/ios_ntp_global.py | 2 +- plugins/modules/ios_ospf_interfaces.py | 1 - plugins/modules/ios_ospfv2.py | 2 +- plugins/modules/ios_prefix_lists.py | 2 -- plugins/modules/ios_service.py | 4 ++-- plugins/modules/ios_snmp_server.py | 3 +-- plugins/modules/ios_static_routes.py | 1 - plugins/modules/ios_vlans.py | 2 +- plugins/modules/ios_vrf.py | 1 - 22 files changed, 17 insertions(+), 28 deletions(-) diff --git a/plugins/modules/ios_acl_interfaces.py b/plugins/modules/ios_acl_interfaces.py index dfdc08528..a67de7274 100644 --- a/plugins/modules/ios_acl_interfaces.py +++ b/plugins/modules/ios_acl_interfaces.py @@ -325,7 +325,7 @@ # ip access-group 123 out # Using DELETED without any config passed -#"(NOTE: This will delete all of configured resource module attributes from each configured interface)" +# "(NOTE: This will delete all of configured resource module attributes from each configured interface)" # Before state: # ------------- diff --git a/plugins/modules/ios_acls.py b/plugins/modules/ios_acls.py index 029a564a9..7faa8a040 100644 --- a/plugins/modules/ios_acls.py +++ b/plugins/modules/ios_acls.py @@ -690,7 +690,7 @@ address: 192.168.3.0 wildcard_bits: 255.255.255.0 destination: - any: True + any: true grant: permit - grant: deny protocol_options: diff --git a/plugins/modules/ios_banner.py b/plugins/modules/ios_banner.py index 7c937b122..ca3985c3f 100644 --- a/plugins/modules/ios_banner.py +++ b/plugins/modules/ios_banner.py @@ -85,7 +85,7 @@ - name: Configure banner from file cisco.ios.ios_banner: banner: motd - text: "{{ lookup('file', './config_partial/raw_banner.cfg') }}" # Use unix formatted text files (LF not CRLF) to avoid idempotency issues. + text: "{{ lookup('file', './config_partial/raw_banner.cfg') }}" # Use unix formatted text files (LF not CRLF) to avoid idempotency issues. state: present - name: Configure the login banner using delimiter diff --git a/plugins/modules/ios_command.py b/plugins/modules/ios_command.py index bf37cd771..38756f4de 100644 --- a/plugins/modules/ios_command.py +++ b/plugins/modules/ios_command.py @@ -337,7 +337,6 @@ # ] # ] # } - """ RETURN = """ diff --git a/plugins/modules/ios_config.py b/plugins/modules/ios_config.py index bbecd2a03..af73c230c 100644 --- a/plugins/modules/ios_config.py +++ b/plugins/modules/ios_config.py @@ -322,7 +322,6 @@ # permit ip host 192.0.2.2 any log # permit ip host 192.0.2.3 any log # permit ip host 192.0.2.4 any log - """ RETURN = """ diff --git a/plugins/modules/ios_hostname.py b/plugins/modules/ios_hostname.py index 2949fc584..b8efdd5b8 100644 --- a/plugins/modules/ios_hostname.py +++ b/plugins/modules/ios_hostname.py @@ -194,7 +194,7 @@ # Before state: # ------------- -#router-ios#show running-config | section ^hostname +# router-ios#show running-config | section ^hostname # hostname RouterTest # Gathered play: diff --git a/plugins/modules/ios_l3_interfaces.py b/plugins/modules/ios_l3_interfaces.py index 7ea6d0d7a..0f6924124 100644 --- a/plugins/modules/ios_l3_interfaces.py +++ b/plugins/modules/ios_l3_interfaces.py @@ -827,7 +827,6 @@ # ipv6: # - address: 2001:db8:0:3::/64 # name: GigabitEthernet0/2 - """ RETURN = """ diff --git a/plugins/modules/ios_lacp_interfaces.py b/plugins/modules/ios_lacp_interfaces.py index fe8e92bcc..aeec9db42 100644 --- a/plugins/modules/ios_lacp_interfaces.py +++ b/plugins/modules/ios_lacp_interfaces.py @@ -451,7 +451,6 @@ # "name": "Port-channel10" # } # ] - """ RETURN = """ diff --git a/plugins/modules/ios_lag_interfaces.py b/plugins/modules/ios_lag_interfaces.py index 64a43f700..e716cf4d4 100644 --- a/plugins/modules/ios_lag_interfaces.py +++ b/plugins/modules/ios_lag_interfaces.py @@ -135,7 +135,7 @@ - name: Port-channel20 members: - member: GigabitEthernet0/3 - mode: on + mode: "on" - name: Port-channel30 members: - member: GigabitEthernet0/4 @@ -358,7 +358,7 @@ # channel-group 30 mode active # Using Deleted without any config passed -#"(NOTE: This will delete all of configured LLDP module attributes)" +# "(NOTE: This will delete all of configured LLDP module attributes)" # # Before state: diff --git a/plugins/modules/ios_linkagg.py b/plugins/modules/ios_linkagg.py index cadc5551c..4572afe42 100644 --- a/plugins/modules/ios_linkagg.py +++ b/plugins/modules/ios_linkagg.py @@ -138,9 +138,8 @@ - name: Create aggregate of linkagg definitions cisco.ios.ios_linkagg: aggregate: - - { group: 3, mode: on, members: [GigabitEthernet0/1] } + - { group: 3, mode: "on", members: [GigabitEthernet0/1] } - { group: 100, mode: passive, members: [GigabitEthernet0/2] } - """ RETURN = """ diff --git a/plugins/modules/ios_lldp_global.py b/plugins/modules/ios_lldp_global.py index db9eb44ef..bef63639e 100644 --- a/plugins/modules/ios_lldp_global.py +++ b/plugins/modules/ios_lldp_global.py @@ -201,7 +201,7 @@ # lldp reinit 5 # Using Deleted without any config passed -#"(NOTE: This will delete all of configured LLDP module attributes)" +# "(NOTE: This will delete all of configured LLDP module attributes)" # Before state: # ------------- @@ -299,7 +299,6 @@ # "reinit": 3, # "timer": 10 # } - """ RETURN = """ diff --git a/plugins/modules/ios_logging_global.py b/plugins/modules/ios_logging_global.py index a77ca1115..aab889772 100644 --- a/plugins/modules/ios_logging_global.py +++ b/plugins/modules/ios_logging_global.py @@ -702,7 +702,7 @@ # Before state: # ------------- -#router-ios#show running-config | section logging +# router-ios#show running-config | section logging # logging exception 4099 # logging message-counter log # logging userinfo diff --git a/plugins/modules/ios_ntp.py b/plugins/modules/ios_ntp.py index 2eeb2b088..065054411 100644 --- a/plugins/modules/ios_ntp.py +++ b/plugins/modules/ios_ntp.py @@ -116,8 +116,8 @@ auth_key: 15435A030726242723273C21181319000A auth: true state: present - """ + RETURN = """ commands: description: command sent to the device @@ -125,6 +125,7 @@ type: list sample: ["no ntp server 10.0.255.10", "no ntp source Loopback0"] """ + import re from ansible.module_utils.basic import AnsibleModule diff --git a/plugins/modules/ios_ntp_global.py b/plugins/modules/ios_ntp_global.py index 87c37a25f..6293b4c0d 100644 --- a/plugins/modules/ios_ntp_global.py +++ b/plugins/modules/ios_ntp_global.py @@ -608,7 +608,7 @@ # Before state: # ------------- -#router-ios#show running-config | section ^ntp +# router-ios#show running-config | section ^ntp # ntp max-associations 34 # ntp logging # ntp allow mode control 4 diff --git a/plugins/modules/ios_ospf_interfaces.py b/plugins/modules/ios_ospf_interfaces.py index f2a86cd4a..fc2144296 100644 --- a/plugins/modules/ios_ospf_interfaces.py +++ b/plugins/modules/ios_ospf_interfaces.py @@ -1236,7 +1236,6 @@ # transmit_delay: 45 # name: GigabitEthernet0/1 # - name: GigabitEthernet0/0 - """ RETURN = """ diff --git a/plugins/modules/ios_ospfv2.py b/plugins/modules/ios_ospfv2.py index e57c009d7..6268ce46a 100644 --- a/plugins/modules/ios_ospfv2.py +++ b/plugins/modules/ios_ospfv2.py @@ -1010,7 +1010,7 @@ passive_interfaces: default: true interface: - set_interface: False + set_interface: false name: - GigabitEthernet0/1 - GigabitEthernet0/2 diff --git a/plugins/modules/ios_prefix_lists.py b/plugins/modules/ios_prefix_lists.py index 05c71fec9..311834c76 100644 --- a/plugins/modules/ios_prefix_lists.py +++ b/plugins/modules/ios_prefix_lists.py @@ -263,8 +263,6 @@ - afi: ipv4 state: deleted - - # Task Output # ------------- # before: diff --git a/plugins/modules/ios_service.py b/plugins/modules/ios_service.py index 642ea3738..46c456569 100644 --- a/plugins/modules/ios_service.py +++ b/plugins/modules/ios_service.py @@ -473,8 +473,8 @@ # prompt: true # slave_log: true -#·After·state: -#·------------ +# After state: +# ------------ # # router-ios#show running-config all | section ^service # service slave-log diff --git a/plugins/modules/ios_snmp_server.py b/plugins/modules/ios_snmp_server.py index 20c943104..094d5c48d 100644 --- a/plugins/modules/ios_snmp_server.py +++ b/plugins/modules/ios_snmp_server.py @@ -1848,7 +1848,7 @@ # Before state: # ------------- -#router-ios#show running-config | section ^snmp-server +# router-ios#show running-config | section ^snmp-server # snmp-server engineID remote 172.16.0.12 udp-port 25 AB0C5342FF0F # snmp-server user userPaul dev v1 access 24 # snmp-server group mergedGroup v3 auth @@ -2554,7 +2554,6 @@ # } # ] # } - """ RETURN = """ diff --git a/plugins/modules/ios_static_routes.py b/plugins/modules/ios_static_routes.py index ffa7290e4..b3c57ad6d 100644 --- a/plugins/modules/ios_static_routes.py +++ b/plugins/modules/ios_static_routes.py @@ -930,7 +930,6 @@ # tag: 50 # track: 150 # vrf: blue - """ RETURN = """ diff --git a/plugins/modules/ios_vlans.py b/plugins/modules/ios_vlans.py index 2877e4318..9e5350be6 100644 --- a/plugins/modules/ios_vlans.py +++ b/plugins/modules/ios_vlans.py @@ -429,7 +429,7 @@ # 1005 trnet 101005 1500 - - - ibm - 0 0 # Using Deleted without any config passed -#"(NOTE: This will delete all of configured vlans attributes)" +# "(NOTE: This will delete all of configured vlans attributes)" # Before state: # ------------- diff --git a/plugins/modules/ios_vrf.py b/plugins/modules/ios_vrf.py index 4165bcae5..4a954d265 100644 --- a/plugins/modules/ios_vrf.py +++ b/plugins/modules/ios_vrf.py @@ -256,7 +256,6 @@ route_both_ipv6: - 1:100 - 3:100 - """ RETURN = """