mirror of
https://github.com/ansible/awx.git
synced 2026-05-19 23:07:42 -02: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:
committed by
Seth Foster
parent
05502c0af8
commit
8f22188116
@@ -126,7 +126,7 @@ def generate_inventory_yml(instance_obj):
|
|||||||
def generate_group_vars_all_yml(instance_obj):
|
def generate_group_vars_all_yml(instance_obj):
|
||||||
# get peers
|
# get peers
|
||||||
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))
|
peers.append(dict(address=addr.get_full_address(), protocol=addr.protocol))
|
||||||
context = dict(instance=instance_obj, peers=peers)
|
context = dict(instance=instance_obj, peers=peers)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user