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:
Satyajit Bulage 2020-07-03 01:52:21 +05:30 committed by GitHub
parent b4184aa50e
commit 4f0ec5a9a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View 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).

View file

@ -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: