First patch fixes provider account rename, second disables unique instance key generation when instance is started - as ssh key distribution is not in branch yet.
From: Jan Provaznik jprovazn@redhat.com
--- src/dbomatic/dbomatic | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/dbomatic/dbomatic b/src/dbomatic/dbomatic index 3ac7449..406388d 100755 --- a/src/dbomatic/dbomatic +++ b/src/dbomatic/dbomatic @@ -203,18 +203,18 @@ class CondorEventLog < Nokogiri::XML::SAX::Document return end
- cloud_account = ProviderAccount.find(:first, :conditions => ['provider_id = ? AND username = ? AND password = ?', provider.id, username, password]) - if cloud_account.nil? + provider_account = ProviderAccount.find(:first, :conditions => ['provider_id = ? AND username = ? AND password = ?', provider.id, username, password]) + if provider_account.nil? @logger.error "Could not find the cloud account corresponding to #{link}, skipping cloud id update" return end
- inst.cloud_account_id = cloud_account.id + inst.provider_account_id = provider_account.id
# FIXME: we are updating the instance_key_id here, but this is really not # the right way or place to do this. This will have to be revisited when # we come up with a real key management architecture - inst.instance_key_id = cloud_account.instance_key.id + inst.instance_key_id = provider_account.instance_key.id
inst.save! end
On Fri, Feb 11, 2011 at 03:58:06PM +0100, jprovazn@redhat.com wrote:
From: Jan Provaznik jprovazn@redhat.com
src/dbomatic/dbomatic | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
ACK and pushed, thank you!
Ian
From: Jan Provaznik jprovazn@redhat.com
--- src/app/models/instance_observer.rb | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/app/models/instance_observer.rb b/src/app/models/instance_observer.rb index e14e8d2..0bc8852 100644 --- a/src/app/models/instance_observer.rb +++ b/src/app/models/instance_observer.rb @@ -61,14 +61,14 @@ class InstanceObserver < ActiveRecord::Observer end end
- def before_update(instance) - # we try to generate key only when instance is running - # and instance_key is not generated yet - return if instance.state != Instance::STATE_RUNNING or instance.instance_key - if key = instance.provider_account.generate_auth_key - instance.instance_key = InstanceKey.create!(:pem => key.pem, :name => key.id, :instance_key_owner => instance) - end - end + #def before_update(instance) + # # we try to generate key only when instance is running + # # and instance_key is not generated yet + # return if instance.state != Instance::STATE_RUNNING or instance.instance_key + # if key = instance.provider_account.generate_auth_key + # instance.instance_key = InstanceKey.create!(:pem => key.pem, :name => key.id, :instance_key_owner => instance) + # end + #end
end
On Fri, Feb 11, 2011 at 03:58:07PM +0100, jprovazn@redhat.com wrote:
From: Jan Provaznik jprovazn@redhat.com
src/app/models/instance_observer.rb | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-)
ACK and pushed, thanks again.
Ian
On Fri, Feb 11, 2011 at 03:58:05PM +0100, jprovazn@redhat.com wrote:
First patch fixes provider account rename, second disables unique instance key generation when instance is started - as ssh key distribution is not in branch yet.
Awesome, thanks Jan! These patches seem to fix dbomatic completely.
Ian
aeolus-devel@lists.fedorahosted.org