From 88ff64e81f9bf792c78941ef4d9e73e2f4b7ee57 Mon Sep 17 00:00:00 2001
From: Alexey Wasilyev <awasilyev@qubell.com>
Date: Fri, 8 Aug 2014 18:42:40 +0400
Subject: [PATCH] Fix for #8344

---
 library/cloud/ec2_eip | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/library/cloud/ec2_eip b/library/cloud/ec2_eip
index 73efbe662df..cff83e482b3 100644
--- a/library/cloud/ec2_eip
+++ b/library/cloud/ec2_eip
@@ -190,7 +190,7 @@ def allocate_address(ec2, domain, module, reuse_existing_ip_allowed):
         domain_filter = { 'domain' : 'standard' }
       all_addresses = ec2.get_all_addresses(filters=domain_filter)
 
-      unassociated_addresses = filter(lambda a: a.instance_id is None, all_addresses)
+      unassociated_addresses = filter(lambda a: a.instance_id == "", all_addresses)
       if unassociated_addresses:
         address = unassociated_addresses[0];
       else: