diff --git a/lib/chef/knife/solo_cook.rb b/lib/chef/knife/solo_cook.rb index 70295557..752cfa36 100644 --- a/lib/chef/knife/solo_cook.rb +++ b/lib/chef/knife/solo_cook.rb @@ -317,11 +317,11 @@ def chef_version_satisfies?(requirement) Gem::Requirement.new(requirement).satisfied_by? Gem::Version.new(chef_version) end - # Parses "Chef: x.y.z" from the chef-solo version output + # Parses "Chef: x.y.z" and "Chef Infra Client: x.y.z" from the chef-solo version output def chef_version # Memoize the version to avoid multiple SSH calls @chef_version ||= lambda do - cmd = %q{sudo chef-solo --version 2>/dev/null | awk '$1 == "Chef:" {print $2}'} + cmd = %q{sudo chef-solo --version 2>/dev/null | awk -F ": " '/Chef/{print $2}'} run_command(cmd).stdout.strip end.call end