Permalink
Browse files

Cast the passed options to Server#create before checking for validity

  • Loading branch information...
1 parent 247639c commit 4ce178db584aad5994b303b3e7d801006f71707c @dsander dsander committed Feb 16, 2013
Showing with 7 additions and 2 deletions.
  1. +5 −0 CHANGELOG.md
  2. +1 −1 lib/profitbricks.rb
  3. +1 −1 lib/profitbricks/server.rb
View
@@ -1,3 +1,8 @@
+=== 0.9.5 / 2013-02-16
+
+* 1 bug fix:
+ * Cast the passed options to Server#create before checking for validity
+
=== 0.9.1 / 2012-05-16
* 1 bug fix:
View
@@ -13,7 +13,7 @@
require 'profitbricks/rule'
module Profitbricks
- VERSION = '0.9.4'
+ VERSION = '0.9.5'
end
PB = Profitbricks
@@ -69,7 +69,7 @@ class << self
# @return [Server] The created virtual server
def create(options = {})
raise ArgumentError.new("You must provide :cores and :ram") if options[:ram].nil? and options[:cores].nil?
- raise ArgumentError.new(":ram has to be at least 256MiB and a multiple of it") if options[:ram] < 256 or (options[:ram] % 256) > 0
+ raise ArgumentError.new(":ram has to be at least 256MiB and a multiple of it") if options[:ram].to_i < 256 or (options[:ram].to_i % 256) > 0
raise ArgumentError.new(":os_type has to be either 'WINDOWS' or 'OTHER'") if options[:os_type] and !['WINDOWS', 'OTHER'].include? options[:os_type]
xml = "<arg0>"
xml += get_xml_and_update_attributes options,

0 comments on commit 4ce178d

Please sign in to comment.