From f9a9c75697aacc60f69de579acd0857fc4c1430d Mon Sep 17 00:00:00 2001 From: Justin Santa Barbara Date: Thu, 27 Nov 2014 17:31:02 -0800 Subject: [PATCH] Don't assume every AWS VPC has tags The default VPC has no tags (by default), so we should use get() --- cluster/aws/util.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cluster/aws/util.sh b/cluster/aws/util.sh index c69a967a4fc..50758fa06e0 100644 --- a/cluster/aws/util.sh +++ b/cluster/aws/util.sh @@ -33,7 +33,7 @@ function get_instance_ids { } function get_vpc_id { - python -c 'import json,sys; lst = [str(vpc["VpcId"]) for vpc in json.load(sys.stdin)["Vpcs"] for tag in vpc["Tags"] if tag["Value"] == "kubernetes-vpc"]; print "".join(lst)' + python -c 'import json,sys; lst = [str(vpc["VpcId"]) for vpc in json.load(sys.stdin)["Vpcs"] for tag in vpc.get("Tags", []) if tag["Value"] == "kubernetes-vpc"]; print "".join(lst)' } function get_subnet_id {