Skip to content
This repository has been archived by the owner on Mar 19, 2022. It is now read-only.

Commit

Permalink
mirror SoloCook#ssl_verify_mode for Chef version checking
Browse files Browse the repository at this point in the history
  • Loading branch information
yacn committed Sep 5, 2018
1 parent 0b6677c commit ed9567a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/chef/knife/solo_cook.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ class Knife
# Approach ported from spatula (https://github.com/trotter/spatula)
# Copyright 2009, Trotter Cashion
class SoloCook < Knife
CHEF_VERSION_CONSTRAINT = ">=0.10.4" unless defined? CHEF_VERSION_CONSTRAINT

include KnifeSolo::SshCommand
include KnifeSolo::NodeConfigCommand
Expand Down Expand Up @@ -148,6 +147,10 @@ def solo_legacy_mode
Chef::Config[:solo_legacy_mode] || false
end

def chef_version_constraint
Chef::Config[:solo_chef_version] || ">=0.10.4"
end

def log_level
config_value(:log_level, Chef::Config[:log_level] || :warn).to_sym
end
Expand Down Expand Up @@ -302,9 +305,8 @@ def rsync(source_path, target_path, extra_opts = ['--delete-after', '-zt'])

def check_chef_version
ui.msg "Checking Chef version..."
version = Chef::Config[:knife][:solo_chef_version] || CHEF_VERSION_CONSTRAINT
unless chef_version_satisfies?(version)
raise "Couldn't find Chef #{version} on #{host}. Please run `knife solo prepare #{ssh_args}` to ensure Chef is installed and up to date."
unless chef_version_satisfies?(chef_version_constraint)
raise "Couldn't find Chef #{chef_version_constraint} on #{host}. Please run `knife solo prepare #{ssh_args}` to ensure Chef is installed and up to date."
end
if node_environment != '_default' && chef_version_satisfies?('<11.6.0')
ui.warn "Chef version #{chef_version} does not support environments. Environment '#{node_environment}' will be ignored."
Expand Down

0 comments on commit ed9567a

Please sign in to comment.