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

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