give precedence to ansible.builtins

This commit is contained in:
Klaus Zerwes 2022-09-19 20:37:06 +02:00
parent 2dd84ffbeb
commit e59b131e12

View File

@ -222,6 +222,12 @@ if not fqcnmapfile or args.updatefqcnmapfile:
if nonfqcn not in fqcndict.keys():
fqcndict[nonfqcn] = []
if fqcn not in fqcndict[nonfqcn]:
# this defines the precedence of the replacements made
if fqcn.startswith('ansible.builtin.'):
fqcndict[nonfqcn].insert(0, fqcn)
elif fqcn.startswith('ansible.'):
fqcndict[nonfqcn].insert(0, fqcn)
else:
fqcndict[nonfqcn].append(fqcn)
print('%s : %s -> %s' % (modname, nonfqcn, fqcn))
with open(args.fqcnmapfile, "w", encoding="utf-8") as fqcnmapfile: