Skip to content

Commit a3a71de

Browse files
author
Bradley A. Thornton
committed
README update, and fixes necessary for stub module and facts to work
1 parent cdb3c43 commit a3a71de

File tree

4 files changed

+15
-21
lines changed

4 files changed

+15
-21
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ ansible-playbook -e parent=~/github/rm_example/roles/my_role \
156156

157157
**Using the collection layout**
158158

159-
Note: As of 3/26/2019, the following PR needs to be used:
160159
```
161160
git clone [email protected]:ansible/ansible.git
162161
cd ansible

models/myos/interfaces/myos_interfaces.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,16 @@ DOCUMENTATION: |
5353
description:
5454
- The property_01
5555
type: str
56-
state:
57-
description:
58-
- The state the configuration should be left in
59-
type: str
60-
choices:
61-
- merged
62-
- replaced
63-
- overridden
64-
- deleted
65-
default: merged
56+
state:
57+
description:
58+
- The state the configuration should be left in
59+
type: str
60+
choices:
61+
- merged
62+
- replaced
63+
- overridden
64+
- deleted
65+
default: merged
6666
EXAMPLES:
6767
- deleted_example_01.txt
6868
- merged_example_01.txt

roles/resource_module/templates/module_directory/network_os/network_os_facts.py.j2

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,9 @@ def main():
9696
gather_subset = module.params['gather_subset']
9797
gather_network_resources = module.params['gather_network_resources']
9898
result = Facts().get_facts(module, connection, gather_subset, gather_network_resources)
99-
100-
try:
101-
ansible_facts, warning = result
102-
warnings.extend(warning)
103-
except (TypeError, KeyError):
104-
ansible_facts = result
99+
100+
ansible_facts, additional_warnings = result
101+
warnings.extend(additional_warnings)
105102

106103
module.exit_json(ansible_facts=ansible_facts, warnings=warnings)
107104

roles/resource_module/templates/module_utils/network_os/facts/facts.py.j2

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,8 @@ class Facts(FactsArgs, FactsBase): #pylint: disable=R0903
110110
key = 'ansible_net_%s' % key
111111
self.ansible_facts[key] = value
112112

113-
if warnings:
114-
return self.ansible_facts, warnings
115-
else:
116-
return self.ansible_facts
113+
return self.ansible_facts, warnings
114+
117115

118116

119117
@staticmethod

0 commit comments

Comments
 (0)