Blame SOURCES/bz1568588-6-gcp-move-vip-filter-aggregatedlist.patch

7b144c
From 6bd66e337922403cb2dd3a8715ae401def8c0437 Mon Sep 17 00:00:00 2001
7b144c
From: Helen Koike <helen.koike@collabora.com>
7b144c
Date: Thu, 19 Jul 2018 13:00:58 -0300
7b144c
Subject: [PATCH] gcp-vpc-move-vip.in: filter call to aggregatedList
7b144c
7b144c
Don't list all the instances in the project, filter only the one we are
7b144c
interested in.
7b144c
---
7b144c
 heartbeat/gcp-vpc-move-vip.in | 3 ++-
7b144c
 1 file changed, 2 insertions(+), 1 deletion(-)
7b144c
7b144c
diff --git a/heartbeat/gcp-vpc-move-vip.in b/heartbeat/gcp-vpc-move-vip.in
7b144c
index 9fc87242f..af2080502 100755
7b144c
--- a/heartbeat/gcp-vpc-move-vip.in
7b144c
+++ b/heartbeat/gcp-vpc-move-vip.in
7b144c
@@ -169,7 +169,8 @@ def get_localhost_alias():
7b144c
 
7b144c
 
7b144c
 def get_zone(project, instance):
7b144c
-  request = CONN.instances().aggregatedList(project=project)
7b144c
+  fl = 'name="%s"' % instance
7b144c
+  request = CONN.instances().aggregatedList(project=project, filter=fl)
7b144c
   while request is not None:
7b144c
     response = request.execute()
7b144c
     zones = response.get('items', {})