mirror of
https://github.com/ansible/awx.git
synced 2026-01-20 06:01:25 -03:30
Merge pull request #1794 from anoek/migration-fixes
Fixed JobTemplate migration when inventory is NULL
This commit is contained in:
commit
4c0f4363be
@ -142,7 +142,12 @@ def _discover_credentials(instances, cred, orgfunc):
|
||||
'''
|
||||
orgs = defaultdict(list)
|
||||
for inst in instances:
|
||||
orgs[orgfunc(inst)].append(inst)
|
||||
try:
|
||||
orgs[orgfunc(inst)].append(inst)
|
||||
except AttributeError:
|
||||
# JobTemplate.inventory can be NULL sometimes, eg when an inventory
|
||||
# has been deleted. This protects against that.
|
||||
pass
|
||||
|
||||
if len(orgs) == 1:
|
||||
_update_credential_parents(orgfunc(instances[0]), cred)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user