[AWS] Added a bug fix for ec2 driver

Description:
- In ec2 driver, driver was trying to connect to regions using
ec2.cloudwatch. It was throwing an AttributeError exception as ec2
don't have cloudwatch module

Change-Id: I9a47d4c63c167a85c57cedbcec59dcb4ebf10f23
This commit is contained in:
Pratik Shah 2017-10-04 17:40:02 +05:30
parent 2de1192137
commit bcf7055acf
1 changed files with 2 additions and 1 deletions

View File

@ -22,6 +22,7 @@ import time
import uuid
from boto import ec2
from boto.ec2 import cloudwatch
from boto import exception as boto_exc
from boto.exception import EC2ResponseError
from boto.regioninfo import RegionInfo
@ -189,7 +190,7 @@ class EC2Driver(driver.ComputeDriver):
aws_secret_access_key=CONF.AWS.secret_key,
region=region)
self.cloudwatch_conn = ec2.cloudwatch.connect_to_region(
self.cloudwatch_conn = cloudwatch.connect_to_region(
aws_region, aws_access_key_id=CONF.AWS.access_key,
aws_secret_access_key=CONF.AWS.secret_key)