-
Notifications
You must be signed in to change notification settings - Fork 145
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
Bootstrap autodelete #367
Bootstrap autodelete #367
Conversation
# Name is set this way so it will be cleaned up by CollectionFactory | ||
server = @subject.bootstrap({ :name => "#{CollectionFactory::PREFIX}-#{Time.now.to_i}", | ||
:username => user }) | ||
boot_disk = server.disks.find { |disk| disk[:boot] } |
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.
Style/CollectionMethods: Prefer detect over find.
|
||
File.stub :read, key do | ||
# Name is set this way so it will be cleaned up by CollectionFactory | ||
server = @subject.bootstrap({ :name => "#{CollectionFactory::PREFIX}-#{Time.now.to_i}", |
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.
Style/BracesAroundHashParameters: Redundant curly braces around a hash parameter.
77a80ac
to
50e6a29
Compare
File.stub :read, key do | ||
# Name is set this way so it will be cleaned up by CollectionFactory | ||
server = @subject.bootstrap( :name => "#{CollectionFactory::PREFIX}-#{Time.now.to_i}", | ||
:username => user ) |
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/AlignHash: Align the elements of a hash literal if they span more than one line.
Layout/SpaceInsideParens: Space inside parentheses detected.
|
||
File.stub :read, key do | ||
# Name is set this way so it will be cleaned up by CollectionFactory | ||
server = @subject.bootstrap( :name => "#{CollectionFactory::PREFIX}-#{Time.now.to_i}", |
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/SpaceInsideParens: Space inside parentheses detected.
Some work towards fog#368
# TODO: Remove the network init when #360 is fixed | ||
network = { :network => "global/networks/default", | ||
:access_configs => [{ :name => 'External NAT', | ||
:type => 'ONE_TO_ONE_NAT' }] } |
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.
Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
) | ||
# TODO: Remove the network init when #360 is fixed | ||
network = { :network => "global/networks/default", | ||
:access_configs => [{ :name => 'External NAT', |
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.
Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
.sshable? Was never removed, it’s just part of the parent Fog::Compute::Server class. Switching to .ready? here since .sshable? requires `net-ssh` Updated example to match
900f72e
to
f5ce19b
Compare
Forgot the code path where the key doesn’t exist, also assertions were the other way around *shame cube*
Seems this codepath wasn’t tested ever so adding a test so that we’re covered.
All tests pass \o/ Merging. |
Fog::Compute::Google::Server.bootstrap
Fog::Compute::Google::Server.bootstrap
.bootstrap
Fixes #17