-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixing Fog::Server user/sshkey workflow #366
Conversation
For some reason those were abandoned in 1.0, so core examples no longer worked. E.g. the following no longer provisioned the keys properly: server = connection.servers.create( :name => "fog-smoke-test-#{Time.now.to_i}", :disks => [disk], :machine_type => "n1-standard-1", :private_key_path => File.expand_path("~/.ssh/id_rsa"), :public_key_path => File.expand_path("~/.ssh/id_rsa.pub"), :zone => "us-central1-f", :username => ENV["USER"], :tags => ["fog"], :service_accounts => { :scopes => %w(sql-admin bigquery https://www.googleapis.com/auth/compute) } )
To make sure Fog::Compute::Google::Server properly processes ssh keys and responds to Fog::Compute::Server core methods.
"Fog::Compute::Google::Server loads public_key properly") | ||
end | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/TrailingBlankLines: Final newline missing.
test/unit/compute/test_server.rb
Outdated
|
||
File.stub :read, key do | ||
server = Fog::Compute::Google::Server.new( | ||
:name => "foo", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/FirstParameterIndentation: Indent the first parameter one step more than the start of the previous line.
test/unit/compute/test_server.rb
Outdated
# require testing stuff | ||
|
||
class UnitTestServer < MiniTest::Test | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/EmptyLinesAroundClassBody: Extra empty line detected at class body beginning.
test/unit/compute/test_server.rb
Outdated
@@ -0,0 +1,30 @@ | |||
require "helpers/test_helper" | |||
# require testing stuff |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/TrailingWhitespace: Trailing whitespace detected.
"Fog::Compute::Google::Server loads public_key properly") | ||
end | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/TrailingBlankLines: Final newline missing.
test/unit/compute/test_server.rb
Outdated
|
||
File.stub :read, key do | ||
server = Fog::Compute::Google::Server.new( | ||
:name => "foo", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/FirstParameterIndentation: Indent the first parameter one step more than the start of the previous line.
test/unit/compute/test_server.rb
Outdated
# require testing stuff | ||
|
||
class UnitTestServer < MiniTest::Test | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/EmptyLinesAroundClassBody: Extra empty line detected at class body beginning.
test/unit/compute/test_server.rb
Outdated
@@ -0,0 +1,30 @@ | |||
require "helpers/test_helper" | |||
# require testing stuff |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/TrailingWhitespace: Trailing whitespace detected.
Added a unit test so we don't have to go through this again. |
Now instance manager group tests are failing for no reason :| |
All tests pass, merging. |
For some reason those were abandoned in 1.0, so core examples and
bootstrap
no longer worked.E.g. the following no longer provisioned the keys properly:
This patch will make sure
:private_key_path
and:public_key_path
are processed properly again.Fixing #362
Not even mentioning that
save()
shouldn't have had arguments in the first place.But that's going to be fixed by a larger effort in 2.0 #365