summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJann Kleen <jann@pocketvillage.com>2011-03-27 22:54:11 +0200
committerJann Kleen <jann@pocketvillage.com>2011-03-27 22:54:11 +0200
commit6ae920005d480bd15cb0a3af0cef9816cb73487f (patch)
tree062215b5a8fc3bd2b9a711340eb360bf5ee6cdb8
parent4f7790f9202e533145556a980e852402209a3d12 (diff)
downloadboto-6ae920005d480bd15cb0a3af0cef9816cb73487f.tar.gz
tiny bugfixes
-rw-r--r--boto/ec2/autoscale/__init__.py2
-rw-r--r--boto/ec2/autoscale/policy.py12
2 files changed, 7 insertions, 7 deletions
diff --git a/boto/ec2/autoscale/__init__.py b/boto/ec2/autoscale/__init__.py
index 1679eb37..46308aea 100644
--- a/boto/ec2/autoscale/__init__.py
+++ b/boto/ec2/autoscale/__init__.py
@@ -168,7 +168,7 @@ class AutoScaleConnection(AWSQueryConnection):
:param scaling_policy: ScalingPolicy object.
"""
params = {'AdjustmentType' : scaling_policy.adjustment_type,
- 'AutoScalingGroupName': scaling_policy.as_group.name,
+ 'AutoScalingGroupName': scaling_policy.as_name,
'PolicyName' : scaling_policy.name,
'ScalingAdjustment' : scaling_policy.scaling_adjustment,}
diff --git a/boto/ec2/autoscale/policy.py b/boto/ec2/autoscale/policy.py
index 566f9c7d..e7c9dd11 100644
--- a/boto/ec2/autoscale/policy.py
+++ b/boto/ec2/autoscale/policy.py
@@ -117,8 +117,8 @@ class ScalingPolicy(object):
def __repr__(self):
return 'ScalingPolicy(%s group:%s adjustment:%s)' % (self.name,
- self.group_name,
- self.adjustment_type)
+ self.as_name,
+ self.adjustment_type)
def startElement(self, name, attrs, connection):
if name == 'Alarms':
@@ -133,11 +133,11 @@ class ScalingPolicy(object):
elif name == 'PolicyARN':
self.policy_arn = value
elif name == 'ScalingAdjustment':
- self.scaling_adjustment = value
+ self.scaling_adjustment = int(value)
elif name == 'Cooldown':
self.cooldown = int(value)
elif name == 'AdjustmentType':
- self.adjustment_type = int(value)
+ self.adjustment_type = value
- def delete(self, autoscale_group=None):
- return self.connection.delete_policy(self.name, autoscale_group) \ No newline at end of file
+ def delete(self):
+ return self.connection.delete_policy(self.name, self.as_name) \ No newline at end of file