[PATCH conductor] BZ 800849 - CREATE_FAILED instances will not be marked as vanished

Matt Wagner matt.wagner at redhat.com
Wed Mar 7 22:35:29 UTC 2012


Since they were never created on the backend provider, it doesn't
make a lot of sense to mark them as "vanished." It's also a bad user
experience. Instead, if an instance fails to get created, leave it
in that state.

This resolves https://bugzilla.redhat.com/show_bug.cgi?id=800849
and likely https://bugzilla.redhat.com/show_bug.cgi?id=800837 too.
---
 src/dbomatic/dbomatic |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/dbomatic/dbomatic b/src/dbomatic/dbomatic
index fbe301d..045b3f7 100755
--- a/src/dbomatic/dbomatic
+++ b/src/dbomatic/dbomatic
@@ -214,7 +214,7 @@ def check_one_account(account)
         end
         # Only update the instance / create an event if anything has changed!
         instance.save! if instance.changed?
-      else
+      elsif ![Instance::STATE_CREATE_FAILED, Instance::STATE_VANISHED].include?(instance.state)
         # We have an instance in our database, but it didn't come back over the API
         DBomaticLogger.instance.info("known instance missing from provider: #{instance.name} #{instance.external_key}")
         instance.update_attribute(:state, Instance::STATE_VANISHED)
-- 
1.7.7.6




More information about the aeolus-devel mailing list