Merge pull request #2652 from justinsb/default_vpc_has_no_tags

Don't assume every AWS VPC has tags
This commit is contained in:
Brendan Burns 2014-12-08 15:53:47 -08:00
commit 5b33534dcf

View File

@ -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 {