Skip to content

Commit

Permalink
Fix for #150: Correctly setting the default folder when getting the c…
Browse files Browse the repository at this point in the history
…urrent host state.
  • Loading branch information
lgetwan committed Sep 14, 2022
1 parent feedd68 commit 993b4ce
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 1 deletion.
49 changes: 49 additions & 0 deletions changelogs/fragments/fix-150-default-folder.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# https://docs.ansible.com/ansible/latest/community/development_process.html#changelogs-how-to
bugfixes:
- Fix for 150 - Correctly setting the default folder when getting the current host state.
# minor_changes:
# - Add agent role. Currently supports the vanilla agent.

# known_issues:
# - This release is still in development and a heavy work in progress.
# - Discovery module is not feature complete yet.
# - Downtime module is not fully idempotent yet. This affects service downtimes and deletions.

## Line Format
# When writing a changelog entry, use the following format:

# - scope - description starting with a lowercase letter and ending with a period at the very end. Multiple sentences are allowed (https://github.com/reference/to/an/issue or, if there is no issue, reference to a pull request itself).

# The scope is usually a module or plugin name or group of modules or plugins, for example, lookup plugins. While module names can (and should) be mentioned directly (foo_module), plugin names should always be followed by the type (foo inventory plugin).

# For changes that are not really scoped (for example, which affect a whole collection), use the following format:

# - Description starting with an uppercase letter and ending with a dot at the very end. Multiple sentences are allowed (https://github.com/reference/to/an/issue or, if there is no issue, reference to a pull request itself).


## Possible keys:

# breaking_changes

# Changes that break existing playbooks or roles. This includes any change to existing behavior that forces users to update tasks. Displayed in both the changelogs and the Porting Guides.
# major_changes

# Major changes to Ansible itself. Generally does not include module or plugin changes. Displayed in both the changelogs and the Porting Guides.
# minor_changes

# Minor changes to Ansible, modules, or plugins. This includes new features, new parameters added to modules, or behavior changes to existing parameters.
# deprecated_features

# Features that have been deprecated and are scheduled for removal in a future release. Displayed in both the changelogs and the Porting Guides.
# removed_features

# Features that were previously deprecated and are now removed. Displayed in both the changelogs and the Porting Guides.
# security_fixes

# Fixes that address CVEs or resolve security concerns. Include links to CVE information.
# bugfixes

# Fixes that resolve issues.
# known_issues

# Known issues that are currently not fixed or will not be fixed.
2 changes: 1 addition & 1 deletion plugins/modules/host.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def get_current_host_state(module, base_url, headers):
etag = info.get("etag", "")
extensions = body.get("extensions", {})
current_explicit_attributes = extensions.get("attributes", {})
current_folder = "%s" % extensions.get("folder", "")
current_folder = "%s" % extensions.get("folder", "/")
if "meta_data" in current_explicit_attributes:
del current_explicit_attributes["meta_data"]

Expand Down

0 comments on commit 993b4ce

Please sign in to comment.