From bcf7055acf20178dc083e925fef3cfc808bb7dde Mon Sep 17 00:00:00 2001 From: Pratik Shah Date: Wed, 4 Oct 2017 17:40:02 +0530 Subject: [PATCH] [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 --- nova/virt/ec2/ec2driver.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nova/virt/ec2/ec2driver.py b/nova/virt/ec2/ec2driver.py index 3970fcf..8fc3683 100644 --- a/nova/virt/ec2/ec2driver.py +++ b/nova/virt/ec2/ec2driver.py @@ -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)