Suppress warning for user directory in ansible-inventory (#65344)
When user uses home directory in --playbook-dir option of ansible-inventory command, it warns user about this. This PR suppress the warning message for user's home directory usage in ansible-inventory command. Fixes: #65262 Signed-off-by: Satyajit Bulage <sbulage@redhat.com>
This commit is contained in:
parent
b4184aa50e
commit
4f0ec5a9a0
2 changed files with 3 additions and 1 deletions
2
changelogs/fragments/65262_ansible_inventory.yml
Normal file
2
changelogs/fragments/65262_ansible_inventory.yml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
bugfixes:
|
||||||
|
- Suppress warning when user directory used in --playbook-dir option with ansible-inventory command (https://github.com/ansible/ansible/issues/65262).
|
|
@ -61,7 +61,7 @@ def get_all_plugin_loaders():
|
||||||
|
|
||||||
def add_all_plugin_dirs(path):
|
def add_all_plugin_dirs(path):
|
||||||
''' add any existing plugin dirs in the path provided '''
|
''' add any existing plugin dirs in the path provided '''
|
||||||
b_path = to_bytes(path, errors='surrogate_or_strict')
|
b_path = os.path.expanduser(to_bytes(path, errors='surrogate_or_strict'))
|
||||||
if os.path.isdir(b_path):
|
if os.path.isdir(b_path):
|
||||||
for name, obj in get_all_plugin_loaders():
|
for name, obj in get_all_plugin_loaders():
|
||||||
if obj.subdir:
|
if obj.subdir:
|
||||||
|
|
Loading…
Reference in a new issue