mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Make sure we are comparing bytes extensions in inventory plugins (#42475)
* Ensure we are comparing text paths with extensions. Fixes #42118 * Add changelog
This commit is contained in:
parent
8e1d223301
commit
abb05c98f3
2 changed files with 3 additions and 1 deletions
2
changelogs/fragments/inventory_dir_ext_compare_fix.yaml
Normal file
2
changelogs/fragments/inventory_dir_ext_compare_fix.yaml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
bugfixes:
|
||||||
|
- inventory - When using an inventory directory, ensure extension comparison uses text types (https://github.com/ansible/ansible/pull/42475)
|
|
@ -258,7 +258,7 @@ class InventoryManager(object):
|
||||||
|
|
||||||
# initialize and figure out if plugin wants to attempt parsing this file
|
# initialize and figure out if plugin wants to attempt parsing this file
|
||||||
try:
|
try:
|
||||||
plugin_wants = bool(plugin.verify_file(source))
|
plugin_wants = bool(plugin.verify_file(to_text(source)))
|
||||||
except Exception:
|
except Exception:
|
||||||
plugin_wants = False
|
plugin_wants = False
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue