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

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