Skip to content

Commit

Permalink
0.19.2 release commit
Browse files Browse the repository at this point in the history
  • Loading branch information
dmulyalin committed Apr 30, 2023
1 parent 557fa5a commit d7e6f8f
Show file tree
Hide file tree
Showing 3 changed files with 2,356 additions and 2,164 deletions.
14 changes: 7 additions & 7 deletions nornir_salt/plugins/functions/InventoryFun.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def _create_host(nr, name, groups=None, connection_options=None, **kwargs):
**kwargs
)

return True
return {name: True}


def _read_host(nr, **kwargs):
Expand Down Expand Up @@ -275,7 +275,7 @@ def _update_host(
elif groups_action == "remove" and group_name in existing_groups:
host_obj.groups.remove(nr.inventory.groups[group_name])

return True
return {host_obj.name: True}


def _delete_host(nr, name):
Expand All @@ -286,10 +286,14 @@ def _delete_host(nr, name):
:param name: (str or list) host name or a list of host names to delete
:return: True on success
"""
ret = {}
names = [name] if isinstance(name, str) else name

for n in names:
_ = nr.inventory.hosts.pop(n, None)
return True
ret[name] = True

return ret


def _load(nr, data):
Expand Down Expand Up @@ -413,10 +417,6 @@ def _update_defaults(
attributes - hostname, port, username, password, platform
and extras dictionary
:param data: (dict) dictionary with defaults's data to update
:param password: default passowrd string value
:param username: default username string value
:param port: default port integer value
:param platform: default platform string value
:param kwargs: (dict) additional key-value pairs to add into
defaults data
:return: True on success
Expand Down

0 comments on commit d7e6f8f

Please sign in to comment.