Skip to content

Commit fee5346

Browse files
Merge pull request #22 from NilashishC/fix_facts_description
Some fixes to RM Builder Reviewed-by: Nilashish Chakraborty <[email protected]> https://github.com/NilashishC
2 parents 4c19e00 + a5dde3b commit fee5346

File tree

5 files changed

+18
-16
lines changed

5 files changed

+18
-16
lines changed

roles/resource_module/filter_plugins/to_argspec.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ def dive(obj, required=False):
2424
result['options'][propkey] = dive(propval, required)
2525
elif obj['type'] == 'array':
2626
result['options'] = {}
27+
if obj['elements']:
28+
result['elements'] = obj['elements']
2729
if not 'items' in obj:
2830
raise AnsibleFilterError('missing items key in array')
2931
if not 'properties' in obj['items']:

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ DOCUMENTATION = """
2121
---
2222
module: {{ network_os }}_facts
2323
version_added: {{ rm['info']['version_added'] }}
24-
short_description: {{ rm['info']['short_description'] }}
24+
short_description: Get facts about {{ network_os }} devices.
2525
description:
2626
- Collects facts from network devices running the {{ network_os }} operating
2727
system. This module places the facts gathered in the fact tree keyed by the

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,15 @@ EXAMPLES = """
5656

5757
RETURN = """
5858
before:
59-
description: The configuration prior to the model invocation
59+
description: The configuration prior to the model invocation.
6060
returned: always
61-
sample: The configuration returned will alwys be in the same format of the paramters above.
61+
sample: The configuration returned will always be in the same format of the parameters above.
6262
after:
63-
description: The resulting configuration model invocation
63+
description: The resulting configuration model invocation.
6464
returned: when changed
65-
sample: The configuration returned will alwys be in the same format of the paramters above.
65+
sample: The configuration returned will always be in the same format of the parameters above.
6666
commands:
67-
description: The set of commands pushed to the remote device
67+
description: The set of commands pushed to the remote device.
6868
returned: always
6969
type: list
7070
sample: ['command 1', 'command 2', 'command 3']

roles/resource_module/templates/module_utils/network_os/config/resource/resource.py.j2

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class {{ resource|capitalize }}(ConfigBase, {{ resource|capitalize }}Args):
4545
""" Execute the module
4646
4747
:rtype: A dictionary
48-
:returns: The result from moduel execution
48+
:returns: The result from module execution
4949
"""
5050
result = {'changed': False}
5151
commands = list()
@@ -73,7 +73,7 @@ class {{ resource|capitalize }}(ConfigBase, {{ resource|capitalize }}Args):
7373
7474
:rtype: A list
7575
:returns: the commands necessary to migrate the current configuration
76-
to the deisred configuration
76+
to the desired configuration
7777
"""
7878
want = self._module.params['config']
7979
have = self.get_{{ resource }}_facts()
@@ -87,7 +87,7 @@ class {{ resource|capitalize }}(ConfigBase, {{ resource|capitalize }}Args):
8787
:param have: the current configuration as a dictionary
8888
:rtype: A list
8989
:returns: the commands necessary to migrate the current configuration
90-
to the deisred configuration
90+
to the desired configuration
9191
"""
9292
state = self._module.params['state']
9393
if state == 'overridden':
@@ -105,29 +105,29 @@ class {{ resource|capitalize }}(ConfigBase, {{ resource|capitalize }}Args):
105105
return commands
106106

107107
@staticmethod
108-
def _state_replaced(self, **kwargs):
108+
def _state_replaced(**kwargs):
109109
""" The command generator when state is replaced
110110
111111
:rtype: A list
112112
:returns: the commands necessary to migrate the current configuration
113-
to the deisred configuration
113+
to the desired configuration
114114
"""
115115
commands = []
116116
return commands
117117

118118
@staticmethod
119-
def _state_overridden(self, **kwargs):
119+
def _state_overridden(**kwargs):
120120
""" The command generator when state is overridden
121121
122122
:rtype: A list
123123
:returns: the commands necessary to migrate the current configuration
124-
to the deisred configuration
124+
to the desired configuration
125125
"""
126126
commands = []
127127
return commands
128128

129129
@staticmethod
130-
def _state_merged(self, **kwargs):
130+
def _state_merged(**kwargs):
131131
""" The command generator when state is merged
132132
133133
:rtype: A list
@@ -138,7 +138,7 @@ class {{ resource|capitalize }}(ConfigBase, {{ resource|capitalize }}Args):
138138
return commands
139139

140140
@staticmethod
141-
def _state_deleted(self, **kwargs):
141+
def _state_deleted(**kwargs):
142142
""" The command generator when state is deleted
143143
144144
:rtype: A list

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ class FactsBase(object): #pylint: disable=R0205
9898
9999
:param cfg_dict: A dictionary parsed in the facts system
100100
:rtype: A dictionary
101-
:returns: A dictionary by elimating keys that have null values
101+
:returns: A dictionary by eliminating keys that have null values
102102
"""
103103
final_cfg = {}
104104
if not cfg_dict:

0 commit comments

Comments
 (0)