From 0f95961e33913aae659da3fa652f0cf97aa3fd75 Mon Sep 17 00:00:00 2001 From: Mohan Krishnan Date: Sun, 5 Jan 2014 17:23:43 +0700 Subject: [PATCH] Fix exception being thrown for new instance Currently if we are trying to register an instance that has not yet been registered with the elb an exception is thrown. --- library/cloud/ec2_elb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/cloud/ec2_elb b/library/cloud/ec2_elb index 6a8a25986e..1927d6c3a7 100644 --- a/library/cloud/ec2_elb +++ b/library/cloud/ec2_elb @@ -202,7 +202,7 @@ class ElbManager: if instance_state.state == awaited_state: # Check the current state agains the initial state, and only set # changed if they are different. - if instance_state.state != initial_state.state: + if (initial_state is None) or (instance_state.state != initial_state.state): self.changed = True break elif self._is_instance_state_pending(instance_state):