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>
pull/70447/head
Satyajit Bulage 4 years ago committed by GitHub
parent b4184aa50e
commit 4f0ec5a9a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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…
Cancel
Save