From: Jan Provaznik jprovazn@redhat.com
--- src/db/migrate/20110329104633_rename_ssh_user.rb | 15 +++++++++++++++ src/db/seeds.rb | 2 +- 2 files changed, 16 insertions(+), 1 deletions(-) create mode 100644 src/db/migrate/20110329104633_rename_ssh_user.rb
diff --git a/src/db/migrate/20110329104633_rename_ssh_user.rb b/src/db/migrate/20110329104633_rename_ssh_user.rb new file mode 100644 index 0000000..e77eae3 --- /dev/null +++ b/src/db/migrate/20110329104633_rename_ssh_user.rb @@ -0,0 +1,15 @@ +class RenameSshUser < ActiveRecord::Migration + def self.up + pt = ProviderType.first(:conditions => {:codename => 'ec2'}) + pt.ssh_user = 'root' + pt.home_dir = '/root' + pt.save! + end + + def self.down + pt = ProviderType.first(:conditions => {:codename => 'ec2'}) + pt.ssh_user = 'ec2-user' + pt.home_dir = '/home/ec2-user' + pt.save! + end +end diff --git a/src/db/seeds.rb b/src/db/seeds.rb index 33c78ed..00be305 100644 --- a/src/db/seeds.rb +++ b/src/db/seeds.rb @@ -107,7 +107,7 @@ end # Provider types actually supported if ProviderType.all.empty? ProviderType.create!(:name => "Mock", :build_supported => true, :codename =>"mock") - ProviderType.create!(:name => "Amazon EC2", :build_supported => true, :codename =>"ec2", :ssh_user => "ec2-user", :home_dir => "/home/ec2-user") + ProviderType.create!(:name => "Amazon EC2", :build_supported => true, :codename =>"ec2", :ssh_user => "root", :home_dir => "/root") ProviderType.create!(:name => "GoGrid", :codename =>"gogrid") ProviderType.create!(:name => "Rackspace", :codename =>"rackspace") ProviderType.create!(:name => "RHEV-M", :codename =>"rhevm")
On 03/29/2011 05:04 PM, jprovazn@redhat.com wrote:
From: Jan Provaznikjprovazn@redhat.com
src/db/migrate/20110329104633_rename_ssh_user.rb | 15 +++++++++++++++ src/db/seeds.rb | 2 +- 2 files changed, 16 insertions(+), 1 deletions(-) create mode 100644 src/db/migrate/20110329104633_rename_ssh_user.rb
diff --git a/src/db/migrate/20110329104633_rename_ssh_user.rb b/src/db/migrate/20110329104633_rename_ssh_user.rb new file mode 100644 index 0000000..e77eae3 --- /dev/null +++ b/src/db/migrate/20110329104633_rename_ssh_user.rb @@ -0,0 +1,15 @@ +class RenameSshUser< ActiveRecord::Migration
- def self.up
- pt = ProviderType.first(:conditions => {:codename => 'ec2'})
- pt.ssh_user = 'root'
- pt.home_dir = '/root'
- pt.save!
- end
- def self.down
- pt = ProviderType.first(:conditions => {:codename => 'ec2'})
- pt.ssh_user = 'ec2-user'
- pt.home_dir = '/home/ec2-user'
- pt.save!
- end
+end diff --git a/src/db/seeds.rb b/src/db/seeds.rb index 33c78ed..00be305 100644 --- a/src/db/seeds.rb +++ b/src/db/seeds.rb @@ -107,7 +107,7 @@ end # Provider types actually supported if ProviderType.all.empty? ProviderType.create!(:name => "Mock", :build_supported => true, :codename =>"mock")
- ProviderType.create!(:name => "Amazon EC2", :build_supported => true, :codename =>"ec2", :ssh_user => "ec2-user", :home_dir => "/home/ec2-user")
- ProviderType.create!(:name => "Amazon EC2", :build_supported => true, :codename =>"ec2", :ssh_user => "root", :home_dir => "/root") ProviderType.create!(:name => "GoGrid", :codename =>"gogrid") ProviderType.create!(:name => "Rackspace", :codename =>"rackspace") ProviderType.create!(:name => "RHEV-M", :codename =>"rhevm")
E2E testing was successfuly, so ACK ;)
-- Jozef Zigmund
aeolus-devel@lists.fedorahosted.org