mirror of
https://github.com/zerwes/ansible-fqcn-converter.git
synced 2025-02-25 18:55:30 -06:00
handle error if ansible-doc output is empty but the exit code is zero
This commit is contained in:
parent
8f0af4a2ca
commit
33c24ebd44
@ -124,6 +124,9 @@ if not fqcnmapfile or args.updatefqcnmapfile:
|
|||||||
print('error parsing %s' % modname)
|
print('error parsing %s' % modname)
|
||||||
continue
|
continue
|
||||||
modjson = json.loads(modpr.stdout)
|
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]
|
moddict = modjson[modname]
|
||||||
if 'doc' in moddict and 'collection' in moddict['doc'] and 'module' in moddict['doc']:
|
if 'doc' in moddict and 'collection' in moddict['doc'] and 'module' in moddict['doc']:
|
||||||
fqcn = '%s.%s' % (moddict['doc']['collection'], moddict['doc']['module'])
|
fqcn = '%s.%s' % (moddict['doc']['collection'], moddict['doc']['module'])
|
||||||
|
Loading…
Reference in New Issue
Block a user