mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
* fixes #27066 * replace type() with isinstance()
This commit is contained in:
parent
f1cc5a928c
commit
5537218c94
1 changed files with 13 additions and 4 deletions
|
@ -239,8 +239,17 @@ def get_acl(module, acl_name, seq_number):
|
||||||
acl_body = {}
|
acl_body = {}
|
||||||
|
|
||||||
body = execute_show_command(command, module)[0]
|
body = execute_show_command(command, module)[0]
|
||||||
|
if body:
|
||||||
all_acl_body = body['TABLE_ip_ipv6_mac']['ROW_ip_ipv6_mac']
|
all_acl_body = body['TABLE_ip_ipv6_mac']['ROW_ip_ipv6_mac']
|
||||||
|
else:
|
||||||
|
# no access-lists configured on the device
|
||||||
|
return {}, []
|
||||||
|
|
||||||
|
if isinstance(all_acl_body, dict):
|
||||||
|
# Only 1 ACL configured.
|
||||||
|
if all_acl_body.get('acl_name') == acl_name:
|
||||||
|
acl_body = all_acl_body
|
||||||
|
else:
|
||||||
for acl in all_acl_body:
|
for acl in all_acl_body:
|
||||||
if acl.get('acl_name') == acl_name:
|
if acl.get('acl_name') == acl_name:
|
||||||
acl_body = acl
|
acl_body = acl
|
||||||
|
|
Loading…
Reference in a new issue