From 20cc6233a8ff8c1cc92670a56ee17a6bb8692e0f Mon Sep 17 00:00:00 2001 From: danielsdeleo Date: Tue, 30 Jun 2015 08:52:35 -0700 Subject: Don't mutate recipe name string in versioned_recipe_list fixes #3618 --- lib/chef/run_list/versioned_recipe_list.rb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/chef/run_list/versioned_recipe_list.rb b/lib/chef/run_list/versioned_recipe_list.rb index 7cce6fa48c..2824f08f31 100644 --- a/lib/chef/run_list/versioned_recipe_list.rb +++ b/lib/chef/run_list/versioned_recipe_list.rb @@ -70,15 +70,16 @@ class Chef # @return [Array] Array of strings with fully-qualified recipe names def with_fully_qualified_names_and_version_constraints self.map do |recipe_name| - ret = if recipe_name.include?('::') + qualified_recipe = if recipe_name.include?('::') recipe_name else "#{recipe_name}::default" end - if @versions[recipe_name] - ret << "@#{@versions[recipe_name]}" - end - ret + + version = @versions[recipe_name] + qualified_recipe = "#{qualified_recipe}@#{version}" if version + + qualified_recipe end end end -- cgit v1.2.1