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

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