mirror of
https://github.com/ansible/awx.git
synced 2026-03-13 15:09:32 -02:30
Merge pull request #4 from tgerla/fix-inventory-plugins
Fix inventory plugin import handling
This commit is contained in:
@@ -253,7 +253,7 @@ class ExecutableJsonLoader(BaseLoader):
|
||||
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
(stdout, stderr) = proc.communicate()
|
||||
if proc.returncode != 0:
|
||||
raise ImportException("%s list failed %s with output: %s" % (src, stderr, proc.returncode))
|
||||
raise ImportException("%s list failed %s with output: %s" % (cmd, stderr, proc.returncode))
|
||||
data = {}
|
||||
try:
|
||||
data = json.loads(stdout)
|
||||
@@ -338,7 +338,7 @@ class GenericLoader(object):
|
||||
for f in glob.glob("%s/*" % src):
|
||||
if f.endswith(".ini"):
|
||||
# config files for inventory scripts should be ignored
|
||||
pass
|
||||
continue
|
||||
if not os.path.isdir(f):
|
||||
if os.access(f, os.X_OK):
|
||||
ExecutableJsonLoader().load(f, memGroup)
|
||||
|
||||
Reference in New Issue
Block a user