handle error if ansible-doc output is empty but the exit code is zero

This commit is contained in:
Klaus Zerwes 2022-08-07 07:46:34 +02:00
parent 8f0af4a2ca
commit 33c24ebd44

View File

@ -124,6 +124,9 @@ if not fqcnmapfile or args.updatefqcnmapfile:
print('error parsing %s' % modname)
continue
modjson = json.loads(modpr.stdout)
if not modjson or not modname in modjson.keys():
print('error: no informations for %s' % modname)
continue
moddict = modjson[modname]
if 'doc' in moddict and 'collection' in moddict['doc'] and 'module' in moddict['doc']:
fqcn = '%s.%s' % (moddict['doc']['collection'], moddict['doc']['module'])