Skip to content
This repository was archived by the owner on Jun 12, 2021. It is now read-only.

Commit 3876849

Browse files
committed
updating to use boto3
1 parent 8bd80ce commit 3876849

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

boot-scripts/lib/kubernetes-node-router.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# Author(s):
66
# - Paul Allen ([email protected])
77
import boto
8+
import boto3
89
import boto.ec2
910
import boto.ec2.autoscale
1011
from boto.exception import EC2ResponseError
@@ -111,8 +112,11 @@ def getMyASGSubnets():
111112
global MY_ASG_SUBNETS
112113
if MY_ASG_SUBNETS == None:
113114
MY_ASG_SUBNETS = []
114-
log("AUTOSCALE.get_all_groups -> %s" % AUTOSCALE.get_all_groups())
115-
for subnetId in AUTOSCALE.get_all_groups([getMyAsgName()])[0].vpc_zone_identifier.split(","):
115+
log(AUTOSCALE.describe_auto_scaling_groups(AutoScalingGroupNames=[getMyAsgName()]))
116+
myGroup = AUTOSCALE.describe_auto_scaling_groups(AutoScalingGroupNames=[getMyAsgName()])['AutoScalingGroups'][0]
117+
log("myGroup: %s" % myGroup['VPCZoneIdentifier'])
118+
for subnetId in myGroup['VPCZoneIdentifier'].split(","):
119+
116120
log(" subnetId: %s" % subnetId)
117121
MY_ASG_SUBNETS.append(getSubnetById(subnetId))
118122
return MY_ASG_SUBNETS
@@ -161,7 +165,7 @@ def main():
161165

162166
EC2 = boto.ec2.connect_to_region(getRegion())
163167
VPC = boto.vpc.connect_to_region(getRegion())
164-
AUTOSCALE = boto.ec2.autoscale.connect_to_region(getRegion())
168+
AUTOSCALE = boto3.client('autoscale', region_name=getRegion())
165169

166170
disableSourceDestChecks()
167171
main()

0 commit comments

Comments
 (0)