summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjkeiser <jkeiser@opscode.com>2013-01-03 18:58:30 -0800
committerJohn Keiser <jkeiser@opscode.com>2013-06-07 13:12:15 -0700
commitf590c245baec8afb8fb1057be09db0285ceba7b1 (patch)
tree7eed29f8af6f6b991263ea1b29a239b4ce69b2ae
parent233f984d7a68a87ba3c9d9871929bb32d18f5256 (diff)
downloadchef-f590c245baec8afb8fb1057be09db0285ceba7b1.tar.gz
Honor repo_mode in local filesystem
-rw-r--r--lib/chef/chef_fs/knife.rb7
-rw-r--r--spec/integration/knife/list_spec.rb3
2 files changed, 7 insertions, 3 deletions
diff --git a/lib/chef/chef_fs/knife.rb b/lib/chef/chef_fs/knife.rb
index b70d5341ae..3b74fb8b7e 100644
--- a/lib/chef/chef_fs/knife.rb
+++ b/lib/chef/chef_fs/knife.rb
@@ -67,7 +67,12 @@ class Chef
def object_paths
@object_paths ||= begin
result = {}
- %w(clients cookbooks data_bags environments nodes roles users).each do |object_name|
+ if config[:repo_mode] == 'everything'
+ object_names = %w(clients cookbooks data_bags environments nodes roles users)
+ else
+ object_names = %w(cookbooks data_bags environments roles)
+ end
+ object_names.each do |object_name|
variable_name = "#{object_name[0..-2]}_path" # cookbooks -> cookbook_path
paths = config_var(variable_name.to_sym)
if !paths
diff --git a/spec/integration/knife/list_spec.rb b/spec/integration/knife/list_spec.rb
index cc5e05113b..d75833866f 100644
--- a/spec/integration/knife/list_spec.rb
+++ b/spec/integration/knife/list_spec.rb
@@ -281,7 +281,7 @@ ERROR: /roles/blarghle/blorghle: No such file or directory
file 'users/user2.json', {}
it "knife list -Rp --flat / returns everything" do
- knife('list', '-Rp', '--flat', '/').stdout.should == "/cookbooks/
+ knife('list', '-Rp', '--local', '--flat', '/').stdout.should == "/cookbooks/
/cookbooks/cookbook1/
/cookbooks/cookbook1/metadata.rb
/cookbooks/cookbook2/
@@ -296,7 +296,6 @@ ERROR: /roles/blarghle/blorghle: No such file or directory
/data_bags/bag2/item1.json
/data_bags/bag2/item2.json
/environments/
-/environments/_default.json
/environments/environment1.json
/environments/environment2.json
/roles/