Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ClausHolbechArista committed Aug 2, 2024
1 parent d0f98a9 commit f97b698
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 37 deletions.
36 changes: 18 additions & 18 deletions ansible_collections/arista/avd/plugins/test/contains.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
# Copyright (c) 2023-2024 Arista Networks, Inc.
# Use of this source code is governed by the Apache License 2.0
# that can be found in the LICENSE file.
#
# arista.avd.contains
#
# Example:
# A >>> [1, 2]
# B >>> [3, 4]
# C >>> [2, 3]
#
# Jinja test examples:
# {% if A is arista.avd.contains(B) %} => false
# {% if B is arista.avd.contains(C) %} => true
# {% if C is arista.avd.contains(A) %} => true
# {% if C is arista.avd.contains(B) %} => true
#
# {% if A is arista.avd.contains(0) %} => false
# {% if B is arista.avd.contains(1) %} => false
# {% if C is arista.avd.contains(2) %} => true
# {% if D is arista.avd.contains(3) %} => false <- Protecting against undefined gracefully.

"""
arista.avd.contains test plugin.
Example:
A = [1, 2]
B = [3, 4]
C = [2, 3]
Jinja test examples:
{% if A is arista.avd.contains(B) %} => false
{% if B is arista.avd.contains(C) %} => true
{% if C is arista.avd.contains(A) %} => true
{% if C is arista.avd.contains(B) %} => true
{% if A is arista.avd.contains(0) %} => false
{% if B is arista.avd.contains(1) %} => false
{% if C is arista.avd.contains(2) %} => true
{% if D is arista.avd.contains(3) %} => false <- Protecting against undefined gracefully.
"""

from ansible.errors import AnsibleFilterError

Expand Down
38 changes: 19 additions & 19 deletions ansible_collections/arista/avd/plugins/test/defined.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
# Copyright (c) 2023-2024 Arista Networks, Inc.
# Use of this source code is governed by the Apache License 2.0
# that can be found in the LICENSE file.
#
# arista.avd.defined
#
# Example:
# A is undefined
# B is none
# C is "c"
# D is "d"
#
# Jinja test examples:
# {% if A is arista.avd.defined %} => false
# {% if B is arista.avd.defined %} => false
# {% if C is arista.avd.defined %} => true
# {% if D is arista.avd.defined %} => true
#
# {% if A is arista.avd.defined("c") %} => false
# {% if B is arista.avd.defined("c") %} => false
# {% if C is arista.avd.defined("c") %} => true
# {% if D is arista.avd.defined("c") %} => false

"""
arista.avd.defined test plugin.
Example:
A is undefined
B is none
C is "c"
D is "d"
Jinja test examples:
{% if A is arista.avd.defined %} => false
{% if B is arista.avd.defined %} => false
{% if C is arista.avd.defined %} => true
{% if D is arista.avd.defined %} => true
{% if A is arista.avd.defined("c") %} => false
{% if B is arista.avd.defined("c") %} => false
{% if C is arista.avd.defined("c") %} => true
{% if D is arista.avd.defined("c") %} => false
"""

from ansible.errors import AnsibleTemplateError

Expand Down

0 comments on commit f97b698

Please sign in to comment.