diff options
author | John Keiser <jkeiser@opscode.com> | 2013-06-06 09:28:50 -0700 |
---|---|---|
committer | John Keiser <jkeiser@opscode.com> | 2013-06-07 13:12:36 -0700 |
commit | b4d8fbdc1d7b26d46299570a46e7ab72aff009ba (patch) | |
tree | d9dee4290e5f174a1fde0c547e42f4a8788a5bd8 | |
parent | 8da7858b6020ba72b9ee9a023e5f744fb35ef393 (diff) | |
download | chef-b4d8fbdc1d7b26d46299570a46e7ab72aff009ba.tar.gz |
Add useful description of local_fs repository for chef-zero to print
-rw-r--r-- | lib/chef/chef_fs/chef_fs_data_store.rb | 4 | ||||
-rw-r--r-- | lib/chef/chef_fs/file_system/chef_repository_file_system_root_dir.rb | 17 |
2 files changed, 21 insertions, 0 deletions
diff --git a/lib/chef/chef_fs/chef_fs_data_store.rb b/lib/chef/chef_fs/chef_fs_data_store.rb index 41e1ca59ea..bd8226b92f 100644 --- a/lib/chef/chef_fs/chef_fs_data_store.rb +++ b/lib/chef/chef_fs/chef_fs_data_store.rb @@ -32,6 +32,10 @@ class Chef @memory_store = ChefZero::DataStore::MemoryStore.new end + def publish_description + "Reading and writing data to #{chef_fs.fs_description}" + end + def chef_fs @chef_fs.call end diff --git a/lib/chef/chef_fs/file_system/chef_repository_file_system_root_dir.rb b/lib/chef/chef_fs/file_system/chef_repository_file_system_root_dir.rb index d86f30de73..becbf54f6b 100644 --- a/lib/chef/chef_fs/file_system/chef_repository_file_system_root_dir.rb +++ b/lib/chef/chef_fs/file_system/chef_repository_file_system_root_dir.rb @@ -68,6 +68,23 @@ class Chef nil end + # Used to print out the filesystem + def fs_description + repo_path = File.dirname(child_paths['cookbooks'][0]) + result = "repository at #{repo_path}\n" + if Chef::Config[:versioned_cookbooks] + result << " - Multiple versions per cookbook\n" + else + result << " - One version per cookbook\n" + end + child_paths.each_pair do |name, paths| + if paths.any? { |path| File.dirname(path) != repo_path } + result << " - #{name} at #{paths.map { }.join('')}\n" + end + end + result + end + private def make_child_entry(name) |