Skip to content

Instantly share code, notes, and snippets.

@jesseproudman
Created October 28, 2010 17:35
Show Gist options
  • Save jesseproudman/651878 to your computer and use it in GitHub Desktop.
Save jesseproudman/651878 to your computer and use it in GitHub Desktop.
diff --git a/lib/fog/bluebox/models/compute/server.rb b/lib/fog/bluebox/models/compute/server.rb
index b447b82..5068d4f 100644
--- a/lib/fog/bluebox/models/compute/server.rb
+++ b/lib/fog/bluebox/models/compute/server.rb
@@ -81,12 +81,12 @@ module Fog
def save
raise Fog::Errors::Error.new('Resaving an existing object may create a duplicate') if identity
requires :flavor_id, :image_id
- options = if !password && !public_key
+ options = if !attributes[:password] && !public_key
raise(ArgumentError, "password or public_key is required for this operation")
elsif public_key
{'ssh_public_key' => public_key}
- elsif @password
- {'password' => password}
+ elsif attributes[:password]
+ {'password' => attributes[:password]}
end
options['username'] = username
data = connection.create_block(flavor_id, image_id, options)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment