mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
better information for user from inventory plugins (#46766)
* better information for user from inventory plugins - use foreman as example
This commit is contained in:
parent
a5bd84758a
commit
9e0c2a658f
4 changed files with 13 additions and 4 deletions
|
@ -170,8 +170,13 @@ class BaseInventoryPlugin(AnsiblePlugin):
|
|||
So only call this base class if you expect it to be a file.
|
||||
'''
|
||||
|
||||
valid = False
|
||||
b_path = to_bytes(path, errors='surrogate_or_strict')
|
||||
return (os.path.exists(b_path) and os.access(b_path, os.R_OK))
|
||||
if (os.path.exists(b_path) and os.access(b_path, os.R_OK)):
|
||||
valid = True
|
||||
else:
|
||||
self.display.vvv('Skipping due to inventory source not existing or not being readable by the current user')
|
||||
return valid
|
||||
|
||||
def _populate_host_vars(self, hosts, variables, group=None, port=None):
|
||||
if not isinstance(variables, Mapping):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue