Skip to content

Commit

Permalink
Merge branch 'CHEF-1765'
Browse files Browse the repository at this point in the history
  • Loading branch information
danielsdeleo committed Nov 8, 2010
2 parents dffa422 + 6fde65c commit 3c52e2e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions chef/lib/chef/knife/ec2_server_create.rb
Expand Up @@ -50,7 +50,8 @@ class Ec2ServerCreate < Knife
:short => "-Z ZONE",
:long => "--availability-zone ZONE",
:description => "The Availability Zone",
:default => "us-east-1b"
:default => "us-east-1b",
:proc => Proc.new { |key| Chef::Config[:knife][:availability_zone] = key }

option :chef_node_name,
:short => "-N NAME",
Expand Down Expand Up @@ -154,7 +155,7 @@ def run
:groups => config[:security_groups],
:flavor_id => config[:flavor],
:key_name => Chef::Config[:knife][:aws_ssh_key_id],
:availability_zone => config[:availability_zone]
:availability_zone => Chef::Config[:availability_zone]
)

puts "#{h.color("Instance ID", :cyan)}: #{server.id}"
Expand Down

4 comments on commit 3c52e2e

@rmoriz
Copy link
Contributor

@rmoriz rmoriz commented on 3c52e2e Feb 14, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure with line 158? Doesn't this break the -Z option on the command line?

@danielsdeleo
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It sure looks like that line should use Chef::Config[:knife][:availability_zone]. Have you tried it?

@rmoriz
Copy link
Contributor

@rmoriz rmoriz commented on 3c52e2e Feb 14, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setting with -Z does not work here.
I think line +157 was correct because it uses the parsed config and +55 already reads the data from the parsed knife.rb

@rmoriz
Copy link
Contributor

@rmoriz rmoriz commented on 3c52e2e Feb 14, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've created a pull request:

#55

http://tickets.opscode.com/browse/CHEF-1765

thanks!

Please sign in to comment.