You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by to...@apache.org on 2011/08/10 07:23:34 UTC
svn commit: r1156028 - /libcloud/trunk/libcloud/compute/drivers/ec2.py
Author: tomaz
Date: Wed Aug 10 05:23:34 2011
New Revision: 1156028
URL: http://svn.apache.org/viewvc?rev=1156028&view=rev
Log:
Eucalyptus driver doesn't support filtering on the instance id so don't add
instance filter in the ex_describe_addresses method.
Modified:
libcloud/trunk/libcloud/compute/drivers/ec2.py
Modified: libcloud/trunk/libcloud/compute/drivers/ec2.py
URL: http://svn.apache.org/viewvc/libcloud/trunk/libcloud/compute/drivers/ec2.py?rev=1156028&r1=1156027&r2=1156028&view=diff
==============================================================================
--- libcloud/trunk/libcloud/compute/drivers/ec2.py (original)
+++ libcloud/trunk/libcloud/compute/drivers/ec2.py Wed Aug 10 05:23:34 2011
@@ -692,6 +692,15 @@ class EC2NodeDriver(NodeDriver):
self.connection.request(self.path,
params=params.copy()).object
+ def _add_instance_filter(self, params, node):
+ """
+ Add instance filter to the provided params dictionary.
+ """
+ params.update({
+ 'Filter.0.Name': 'instance-id',
+ 'Filter.0.Value.0': node.id
+ })
+
def ex_describe_addresses(self, nodes):
"""
Return Elastic IP addresses for all the nodes in the provided list.
@@ -709,10 +718,7 @@ class EC2NodeDriver(NodeDriver):
params = {'Action': 'DescribeAddresses'}
if len(nodes) == 1:
- params.update({
- 'Filter.0.Name': 'instance-id',
- 'Filter.0.Value.0': nodes[0].id
- })
+ self._add_instance_filter(params, nodes[0])
result = self.connection.request(self.path,
params=params.copy()).object
@@ -1012,6 +1018,12 @@ class EucNodeDriver(EC2NodeDriver):
raise NotImplementedError(
'list_locations not implemented for this driver')
+ def _add_instance_filter(self, params, node):
+ """
+ Eucalyptus driver doesn't support filtering on instance id so this is a
+ no-op.
+ """
+ pass
# Nimbus clouds have 3 EC2-style instance types but their particular RAM
# allocations are configured by the admin