diff options
author | Thom May <thom@chef.io> | 2018-05-16 15:29:08 +0100 |
---|---|---|
committer | Thom May <thom@chef.io> | 2018-05-16 15:29:08 +0100 |
commit | 098ebb3c7ad9fa5ebbfdb7288241baccb9dae039 (patch) | |
tree | e965777325d24496e03045fd33d8f2dd4d8ec9ff /lib/chef/cookbook_manifest.rb | |
parent | 3a6e55ba3226f41181c53a6725544af42d4525c4 (diff) | |
download | chef-098ebb3c7ad9fa5ebbfdb7288241baccb9dae039.tar.gz |
Fix manifest entries for root filestm/fix_manifest_root_files
We weren't consistently naming root files; in some places in the spec
the names contained the `root_files` segment and in other places they
didn't. This now always uses `root_files`.
Signed-off-by: Thom May <thom@chef.io>
Diffstat (limited to 'lib/chef/cookbook_manifest.rb')
-rw-r--r-- | lib/chef/cookbook_manifest.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/chef/cookbook_manifest.rb b/lib/chef/cookbook_manifest.rb index 526c183339..9adcee6b78 100644 --- a/lib/chef/cookbook_manifest.rb +++ b/lib/chef/cookbook_manifest.rb @@ -204,7 +204,8 @@ class Chef def root_files manifest[:all_files].select do |file| - file[:name].split("/").length == 1 + segment, name = file[:name].split("/") + name.nil? || segment == "root_files" end end @@ -271,7 +272,7 @@ class Chef next if parts[0] == ".." # if we have a root_file, such as metadata.rb, the first part will be "." - return [ pathname.to_s, pathname.to_s, "default" ] if parts.length == 1 + return [ "root_files/#{pathname}", pathname.to_s, "default" ] if parts.length == 1 segment = parts[0] |