Skip to content

Commit

Permalink
[2.6] Cherry pick bugfixes (#193)
Browse files Browse the repository at this point in the history
* Fix templating repeat_for (#190)

Signed-off-by: Trishna Guha <[email protected]>
(cherry picked from commit e08ef8d)

* Fix validate_role_spec typo

Signed-off-by: Trishna Guha <[email protected]>
(cherry picked from commit 91eddb5)

* fix flake8 failure

Signed-off-by: Trishna Guha <[email protected]>
(cherry picked from commit 86f3dc5)

* Add missing boilerplate for net_facts module (#194)

Signed-off-by: Trishna Guha <[email protected]>
(cherry picked from commit 9065535)
  • Loading branch information
trishnaguha authored Oct 29, 2018
1 parent 127bd67 commit 3a6a663
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion action_plugins/validate_role_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class ActionModule(ActionBase):

VALID_MODULE_KWARGS = (
'argument_spec', 'mutually_exclusive', 'required_if',
'required_one_of', 'requred_together'
'required_one_of', 'required_together'
)

def run(self, tmp=None, task_vars=None):
Expand Down
5 changes: 4 additions & 1 deletion lib/network_engine/plugins/template/json_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ def run(self, template, variables=None):

for loop_item in loop_data:
variables[loop_var] = loop_item
templated_value.append(self.template(items, variables))
if isinstance(items, string_types):
templated_value.append(self.template(items, variables))
else:
templated_value.append(self.run(items, variables))

if item_type == 'list':
templated_items[key] = templated_value
Expand Down
4 changes: 4 additions & 0 deletions library/net_facts.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
# (c) 2018, Red Hat, Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)

from __future__ import absolute_import, division, print_function
__metaclass__ = type


ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'network'}
Expand Down
2 changes: 1 addition & 1 deletion lookup_plugins/network_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def _coerce_to_native(self, value):
if not isinstance(value, bool):
try:
value = int(value)
except Exception as exc:
except Exception:
if value is None or len(value) == 0:
return None
return value
Expand Down

0 comments on commit 3a6a663

Please sign in to comment.