Guest User

Untitled

a guest
Jun 20th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. diff --git a/lib/fog/bluebox/models/compute/server.rb b/lib/fog/bluebox/models/compute/server.rb
  2. index b447b82..5068d4f 100644
  3. --- a/lib/fog/bluebox/models/compute/server.rb
  4. +++ b/lib/fog/bluebox/models/compute/server.rb
  5. @@ -81,12 +81,12 @@ module Fog
  6. def save
  7. raise Fog::Errors::Error.new('Resaving an existing object may create a duplicate') if identity
  8. requires :flavor_id, :image_id
  9. - options = if !password && !public_key
  10. + options = if !attributes[:password] && !public_key
  11. raise(ArgumentError, "password or public_key is required for this operation")
  12. elsif public_key
  13. {'ssh_public_key' => public_key}
  14. - elsif @password
  15. - {'password' => password}
  16. + elsif attributes[:password]
  17. + {'password' => attributes[:password]}
  18. end
  19. options['username'] = username
  20. data = connection.create_block(flavor_id, image_id, options)
Add Comment
Please, Sign In to add comment