summaryrefslogtreecommitdiff
path: root/lib/chef/local_mode.rb
diff options
context:
space:
mode:
authorJay Mundrawala <jdmundrawala@gmail.com>2015-09-08 18:18:09 -0500
committerJay Mundrawala <jdmundrawala@gmail.com>2015-09-08 18:25:50 -0500
commitbc0daaae67b2e6bf032e11edbc3057c7531dfc36 (patch)
tree795e8ba1c599c6f93a5d536192578328cb8744d0 /lib/chef/local_mode.rb
parenteac543b05437f6ee1d9f98cc2656e55a189c2934 (diff)
downloadchef-bc0daaae67b2e6bf032e11edbc3057c7531dfc36.tar.gz
Add monkey patch for webrickjdm/webrick-monkey
Ruby 2.1 introduces a regression on Windows in WEBrick. create_listeners does not throw an exception when we're already listening on a port. This seems to only be an issue on Windows. This patch reverts it back to what it was in Ruby 2.0 It seems the regression was introduced in https://github.com/ruby/ruby/commit/b1f493dcd1092fe17cccec998e175516ed5c6e47#diff-4b178393150b2b3a5ec9d77eced1f09e
Diffstat (limited to 'lib/chef/local_mode.rb')
-rw-r--r--lib/chef/local_mode.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/chef/local_mode.rb b/lib/chef/local_mode.rb
index 79fb750dd8..fbb72cd6cb 100644
--- a/lib/chef/local_mode.rb
+++ b/lib/chef/local_mode.rb
@@ -15,6 +15,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
require 'chef/config'
+if Chef::Platform.windows?
+ if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.1')
+ require 'chef/monkey_patches/webrick-utils'
+ end
+end
class Chef
module LocalMode