summaryrefslogtreecommitdiff
path: root/lib/chef/application
diff options
context:
space:
mode:
authordanielsdeleo <dan@getchef.com>2015-03-31 14:33:19 -0700
committerdanielsdeleo <dan@getchef.com>2015-04-01 13:35:01 -0700
commit8157fdea21c913dfb99ee4f8c285d2d64557d4bc (patch)
tree3d4d3998276f92411cc61cac8135befd3de714e2 /lib/chef/application
parentf066fef19be99ba1b857ecaaabc4c70c9201f1d4 (diff)
downloadchef-8157fdea21c913dfb99ee4f8c285d2d64557d4bc.tar.gz
Add --no-listen option to disable zero binding to port
Diffstat (limited to 'lib/chef/application')
-rw-r--r--lib/chef/application/client.rb5
-rw-r--r--lib/chef/application/knife.rb6
2 files changed, 10 insertions, 1 deletions
diff --git a/lib/chef/application/client.rb b/lib/chef/application/client.rb
index 9984ad5b9d..a5faee9d35 100644
--- a/lib/chef/application/client.rb
+++ b/lib/chef/application/client.rb
@@ -258,6 +258,11 @@ class Chef::Application::Client < Chef::Application
:description => "Only run the bare minimum ohai plugins chef needs to function",
:boolean => true
+ option :listen,
+ :long => "--[no-]listen",
+ :description => "Whether a local mode (-z) server binds to a port",
+ :boolean => true
+
IMMEDIATE_RUN_SIGNAL = "1".freeze
attr_reader :chef_client_json
diff --git a/lib/chef/application/knife.rb b/lib/chef/application/knife.rb
index 1a19a45598..af5216ae00 100644
--- a/lib/chef/application/knife.rb
+++ b/lib/chef/application/knife.rb
@@ -121,6 +121,11 @@ class Chef::Application::Knife < Chef::Application
:long => "--chef-zero-port PORT",
:description => "Port (or port range) to start chef-zero on. Port ranges like 1000,1010 or 8889-9999 will try all given ports until one works."
+ option :listen,
+ :long => "--[no-]listen",
+ :description => "Whether a local mode (-z) server binds to a port",
+ :boolean => true
+
option :version,
:short => "-v",
:long => "--version",
@@ -129,7 +134,6 @@ class Chef::Application::Knife < Chef::Application
:proc => lambda {|v| puts "Chef: #{::Chef::VERSION}"},
:exit => 0
-
# Run knife
def run
Mixlib::Log::Formatter.show_time = false