Permalink
Browse files

* version 0.1.2

* FIX --flavor argument when creating servers
  • Loading branch information...
1 parent 0652779 commit 94f029dace5f67e96d9879709c9a3d9a5a6cd6c0 @rubiojr rubiojr committed Aug 17, 2011
Showing with 13 additions and 4 deletions.
  1. +12 −3 lib/chef/knife/brightbox_server_create.rb
  2. +1 −1 lib/knife-brightbox/version.rb
@@ -32,13 +32,21 @@ class BrightboxServerCreate < Knife
Chef::Knife::Bootstrap.load_deps
end
+ FLAVORS = {
+ 'nano' => 'typ-4nssg',
+ 'mini' => 'typ-iqisj',
+ 'small' => 'typ-urtky',
+ 'medium' => 'typ-qdiwq',
+ 'large' => 'typ-mlbt7',
+ }
+
banner "knife brightbox server create (options)"
option :flavor,
:short => "-f FLAVOR",
:long => "--flavor FLAVOR",
- :description => "The flavor of server; default is NANO (512 MB)",
- :proc => Proc.new { |f| Chef::Config[:knife][:flavor] = f },
+ :description => "The flavor of server; default is NANO (512 MB, typ-4nssg)",
+ :proc => Proc.new { |f| Chef::Config[:knife][:flavor] = (FLAVORS[f] || 'typ-4nssg') },
:default => 'typ-4nssg'
option :image,
@@ -134,8 +142,9 @@ def run
server = connection.servers.create(
:name => config[:server_name],
:image_id => Chef::Config[:knife][:image],
- :flavor_id => 'typ-4nssg'
+ :flavor_id => Chef::Config[:knife][:flavor] || config[:flavor]
)
+ puts "\n"
puts "#{ui.color("Instance ID", :cyan)}: #{server.id}"
puts "#{ui.color("Name", :cyan)}: #{server.name}"
@@ -1,6 +1,6 @@
module Knife
module Brightbox
- VERSION = "0.1.1"
+ VERSION = "0.1.2"
MAJOR, MINOR, TINY = VERSION.split('.')
end
end

0 comments on commit 94f029d

Please sign in to comment.