Skip to content

Commit 6561056

Browse files
authored
Update plugins for ansible-lint (#214)
Signed-off-by: Webster Mudge <wmudge@cloudera.com>
1 parent 4eedd09 commit 6561056

File tree

1 file changed

+45
-45
lines changed

1 file changed

+45
-45
lines changed

plugins/filter/core_exe.py

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -20,59 +20,59 @@
2020
__metaclass__ = type
2121

2222
DOCUMENTATION = """
23-
name: combine_onto
24-
author: Webster Mudge (@wmudge) <wmudge@cloudera.com>
25-
short_description: combine two dictionaries
26-
description:
27-
- Create a dictionary (hash/associative array) as a result of merging existing dictionaries.
28-
- This is the reverse of the C(ansible.builtin.combine) filter.
29-
positional: _input, _dicts
30-
options:
31-
_input:
32-
description:
33-
- First dictionary to combine.
34-
type: dict
35-
required: True
36-
_dicts:
37-
description:
38-
- The list of dictionaries to combine
39-
type: list
40-
elements: dict
41-
required: True
42-
recursive:
43-
description:
44-
- If V(True), merge elements recursively.
45-
type: boolean
46-
default: False
47-
list_merge:
48-
description: Behavior when encountering list elements.
49-
type: str
50-
default: replace
51-
choices:
52-
replace: overwrite older entries with newer ones
53-
keep: discard newer entries
54-
append: append newer entries to the older ones
55-
prepend: insert newer entries in front of the older ones
56-
append_rp: append newer entries to the older ones, overwrite duplicates
57-
prepend_rp: insert newer entries in front of the older ones, discard duplicates
23+
name: combine_onto
24+
author: Webster Mudge (@wmudge) <wmudge@cloudera.com>
25+
short_description: combine two dictionaries
26+
description:
27+
- Create a dictionary (hash/associative array) as a result of merging existing dictionaries.
28+
- This is the reverse of the C(ansible.builtin.combine) filter.
29+
positional: _input, _dicts
30+
options:
31+
_input:
32+
description:
33+
- First dictionary to combine.
34+
type: dict
35+
required: True
36+
_dicts:
37+
description:
38+
- The list of dictionaries to combine
39+
type: list
40+
elements: dict
41+
required: True
42+
recursive:
43+
description:
44+
- If V(True), merge elements recursively.
45+
type: boolean
46+
default: False
47+
list_merge:
48+
description: Behavior when encountering list elements.
49+
type: str
50+
default: replace
51+
choices:
52+
replace: overwrite older entries with newer ones
53+
keep: discard newer entries
54+
append: append newer entries to the older ones
55+
prepend: insert newer entries in front of the older ones
56+
append_rp: append newer entries to the older ones, overwrite duplicates
57+
prepend_rp: insert newer entries in front of the older ones, discard duplicates
5858
"""
5959

6060
EXAMPLES = """
61-
# ab => {'a':1, 'b':2, 'c': 4}
62-
ab: "{{ {'a':1, 'b':2} | cloudera.exe.combine_onto({'b':3, 'c':4}) }}"
61+
# ab => {'a':1, 'b':2, 'c': 4}
62+
ab: "{{ {'a':1, 'b':2} | cloudera.exe.combine_onto({'b':3, 'c':4}) }}"
6363
64-
many: "{{ dict1 | cloudera.exe.combine_onto(dict2, dict3, dict4) }}"
64+
many: "{{ dict1 | cloudera.exe.combine_onto(dict2, dict3, dict4) }}"
6565
66-
# defaults => {'a':{'b':3, 'c':4}, 'd': 5}
67-
# customization => {'a':{'c':20}}
68-
# final => {'a':{'b':3, 'c':20}, 'd': 5}
69-
final: "{{ customization | cloudera.exe.combine_onto(defaults, recursive=true) }}"
66+
# defaults => {'a':{'b':3, 'c':4}, 'd': 5}
67+
# customization => {'a':{'c':20}}
68+
# final => {'a':{'b':3, 'c':20}, 'd': 5}
69+
final: "{{ customization | cloudera.exe.combine_onto(defaults, recursive=true) }}"
7070
"""
7171

7272
RETURN = """
73-
_value:
74-
description: Resulting merge of supplied dictionaries.
75-
type: dict
73+
_value:
74+
description: Resulting merge of supplied dictionaries.
75+
type: dict
7676
"""
7777

7878
from ansible.errors import AnsibleFilterError

0 commit comments

Comments
 (0)