mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 01:57:35 -03:30
Use a select_related to build the peers queryset in the install bundle
Since the relationship is ReceptorAddress -> Instance, prefetch_related isn't necessary.
This commit is contained in:
parent
05502c0af8
commit
8f22188116
@ -126,7 +126,7 @@ def generate_inventory_yml(instance_obj):
|
||||
def generate_group_vars_all_yml(instance_obj):
|
||||
# get peers
|
||||
peers = []
|
||||
for addr in instance_obj.peers.all().prefetch_related('instance'):
|
||||
for addr in instance_obj.peers.select_related('instance'):
|
||||
peers.append(dict(address=addr.get_full_address(), protocol=addr.protocol))
|
||||
context = dict(instance=instance_obj, peers=peers)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user