summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThom May <thom@chef.io>2016-04-19 15:11:31 +0100
committerThom May <thom@chef.io>2016-04-21 08:37:08 +0100
commit0751ae06e555442ff0fab8c8839d86d03c1693da (patch)
treec93913c53a2ec0c291d429c920b0317bc064ecbd
parent46e45b16358471e6e339fba4b126d97652fa5f32 (diff)
downloadchef-0751ae06e555442ff0fab8c8839d86d03c1693da.tar.gz
client keys need a sub dir
-rw-r--r--lib/chef/chef_fs/file_system/repository/client_keys_dir.rb4
-rw-r--r--lib/chef/chef_fs/file_system/repository/client_keys_sub_dir.rb42
2 files changed, 44 insertions, 2 deletions
diff --git a/lib/chef/chef_fs/file_system/repository/client_keys_dir.rb b/lib/chef/chef_fs/file_system/repository/client_keys_dir.rb
index 5e8c12080f..9e7e7b3d5c 100644
--- a/lib/chef/chef_fs/file_system/repository/client_keys_dir.rb
+++ b/lib/chef/chef_fs/file_system/repository/client_keys_dir.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require "chef/chef_fs/file_system/repository/client_key"
+require "chef/chef_fs/file_system/repository/client_keys_sub_dir"
require "chef/chef_fs/data_handler/client_key_data_handler"
require "chef/chef_fs/file_system/repository/directory"
@@ -33,7 +33,7 @@ class Chef
protected
def make_child_entry(child_name)
- ClientKey.new(child_name, self)
+ ClientKeysSubDir.new(child_name, self)
end
end
end
diff --git a/lib/chef/chef_fs/file_system/repository/client_keys_sub_dir.rb b/lib/chef/chef_fs/file_system/repository/client_keys_sub_dir.rb
new file mode 100644
index 0000000000..18eb77326b
--- /dev/null
+++ b/lib/chef/chef_fs/file_system/repository/client_keys_sub_dir.rb
@@ -0,0 +1,42 @@
+#
+# Author:: Jordan Running (<jr@chef.io>)
+# Copyright:: Copyright 2013-2016, Chef Software Inc.
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+require "chef/chef_fs/file_system/repository/client_key"
+require "chef/chef_fs/data_handler/client_key_data_handler"
+require "chef/chef_fs/file_system/repository/directory"
+
+class Chef
+ module ChefFS
+ module FileSystem
+ module Repository
+ class ClientKeysSubDir < Repository::Directory
+
+ def can_have_child?(name, is_dir)
+ is_dir && !name.start_with?(".")
+ end
+
+ protected
+
+ def make_child_entry(child_name)
+ ClientKey.new(child_name, self)
+ end
+ end
+ end
+ end
+ end
+end