diff options
author | Adam Jacob <adam@opscode.com> | 2009-12-14 23:30:56 -0800 |
---|---|---|
committer | Adam Jacob <adam@opscode.com> | 2009-12-14 23:30:56 -0800 |
commit | f7deda7c7d10ceb94f83924d0527df1980efd407 (patch) | |
tree | b720f2592c6f7d60508b105eef6bc710baf073c4 /chef/lib/chef/knife/cookbook_show.rb | |
parent | e01711946496160c6321044625945c0b61838991 (diff) | |
download | chef-f7deda7c7d10ceb94f83924d0527df1980efd407.tar.gz |
Adding cookbook commands
Diffstat (limited to 'chef/lib/chef/knife/cookbook_show.rb')
-rw-r--r-- | chef/lib/chef/knife/cookbook_show.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/chef/lib/chef/knife/cookbook_show.rb b/chef/lib/chef/knife/cookbook_show.rb index 239f9b1a3c..eaf23e65d3 100644 --- a/chef/lib/chef/knife/cookbook_show.rb +++ b/chef/lib/chef/knife/cookbook_show.rb @@ -49,7 +49,7 @@ class Chef arguments[:platform] = config[:platform] if config.has_key?(:platform) arguments[:version] = config[:platform_version] if config.has_key?(:platform_version) result = rest.get_rest("cookbooks/#{@name_args[0]}/#{@name_args[1]}?#{make_query_params(arguments)}") - puts result + pretty_print(result) when 2 # We are showing a specific part of the cookbook result = rest.get_rest("cookbooks/#{@name_args[0]}") json_pretty_print(result[@name_args[1]]) @@ -59,11 +59,11 @@ class Chef end def make_query_params(req_opts) - query_part = "" - req_opts.each do |key, value| - query_part << "#{key}=#{URI.escape(value)}" + query_part = Array.new + req_opts.keys.sort { |a,b| a.to_s <=> b.to_s }.each do |key| + query_part << "#{key}=#{URI.escape(req_opts[key])}" end - query_part + query_part.join("&") end end |