Skip to content

Commit

Permalink
Merge pull request #6 from mohitsethi/OC-4513
Browse files Browse the repository at this point in the history
Use the latest gcutils tool.
  • Loading branch information
Chirag Jog committed Oct 25, 2012
2 parents 2313eb6 + b7ee142 commit 9b84769
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
Binary file removed external/gcompute.tar.gz
Binary file not shown.
Binary file added external/gcutil-1.3.4.tar.gz
Binary file not shown.
Binary file removed external/gcutil.tar.gz
Binary file not shown.
4 changes: 2 additions & 2 deletions lib/chef/knife/google_server_create.rb
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class GoogleServerCreate < Knife

option :project,
:short => "-p PROJECT",
:long => "--project_id PROJECT",
:long => "--project PROJECT",
:description => "Google Compute Project",
:proc => Proc.new { |project| Chef::Config[:knife][:google_project] = project}

Expand Down Expand Up @@ -195,7 +195,7 @@ def run
internal_ip_address = locate_config_value(:internal_ip_address) || nil
puts "\n#{ui.color("Waiting for the server to be Instantiated", :magenta)}"
cmd_add_instance = "#{@gcompute} addinstance #{server_name} --machine_type #{flavor} " +
"--zone #{zone} --project_id #{project_id} --tags #{server_name} " +
"--zone #{zone} --project #{project_id} --tags #{server_name} " +
"--authorized_ssh_keys #{user}:#{key_file} --network #{network} " +
"--external_ip_address #{external_ip_address} --print_json"
cmd_add_instance << " --internal_ip_address #{internal_ip_address}" if internal_ip_address
Expand Down
6 changes: 3 additions & 3 deletions lib/chef/knife/google_server_delete.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ class GoogleServerDelete < Knife

banner "knife google server delete SERVER (options)"

option :project_id,
option :project,
:short => "-p PROJECTNAME",
:long => "--project_id PROJECTNAME",
:long => "--project PROJECTNAME",
:description => "Your Google Compute Project Name",
:proc => Proc.new { |project| Chef::Config[:knife][:google_project] = project }

Expand All @@ -44,7 +44,7 @@ def run

@name_args.each do |server|
confirm("Do you really want to delete the server - #{server} ?")
del_instance = exec_shell_cmd("#{@gcompute} deleteinstance #{server} --print_json --project_id=#{project_id} -f")
del_instance = exec_shell_cmd("#{@gcompute} deleteinstance #{server} --print_json --project=#{project_id} -f")
Chef::Log.debug 'Executing ' + del_instance.command

if not del_instance.stderr.downcase.scan("error").empty?
Expand Down
6 changes: 3 additions & 3 deletions lib/chef/knife/google_server_list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ class GoogleServerList < Knife

banner "knife google server list PROJECT_ID (options)"

option :project_id,
option :project,
:short => "-p PROJECT_ID",
:long => "--project_id PROJECT_ID",
:long => "--project PROJECT_ID",
:description => "The Google Compute Engine project identifier",
:proc => Proc.new { |project| Chef::Config[:knife][:google_project] = project }

Expand All @@ -50,7 +50,7 @@ def run

project_id = Chef::Config[:knife][:google_project]
validate_project(project_id)
list_instances = exec_shell_cmd("#{@gcompute} listinstances --print_json --project_id=#{project_id}")
list_instances = exec_shell_cmd("#{@gcompute} listinstances --print_json --project=#{project_id}")
Chef::Log.debug 'Executing ' + list_instances.command
list_instances.run_command

Expand Down

0 comments on commit 9b84769

Please sign in to comment.