diff options
author | Thom May <thom@chef.io> | 2016-04-14 11:31:49 +0100 |
---|---|---|
committer | Thom May <thom@chef.io> | 2016-04-14 11:31:49 +0100 |
commit | 2c5f732e244d4f1490a9d12af523b4cbef05ca36 (patch) | |
tree | d01e584624a17c4a62c96b8f1f5a0fcb74e6d346 /lib/chef/chef_fs | |
parent | ae09fbf015adac842aec21347d776d8c367c6698 (diff) | |
download | chef-2c5f732e244d4f1490a9d12af523b4cbef05ca36.tar.gz |
Rename and add backcompat requires for ChefFS dirstm/fs_dirs_2
Policies, ACLs, and Client Keys directories are renamed to match the
other directories, and backwards compatible requires are added.
Diffstat (limited to 'lib/chef/chef_fs')
-rw-r--r-- | lib/chef/chef_fs/file_system/repository/acls_dir.rb (renamed from lib/chef/chef_fs/file_system/repository/chef_repository_file_system_acls_dir.rb) | 2 | ||||
-rw-r--r-- | lib/chef/chef_fs/file_system/repository/chef_repository_file_system_root_dir.rb | 12 | ||||
-rw-r--r-- | lib/chef/chef_fs/file_system/repository/client_keys_dir.rb (renamed from lib/chef/chef_fs/file_system/repository/chef_repository_file_system_client_keys_dir.rb) | 2 | ||||
-rw-r--r-- | lib/chef/chef_fs/file_system/repository/policies_dir.rb (renamed from lib/chef/chef_fs/file_system/repository/chef_repository_file_system_policies_dir.rb) | 12 |
4 files changed, 16 insertions, 12 deletions
diff --git a/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_acls_dir.rb b/lib/chef/chef_fs/file_system/repository/acls_dir.rb index cb4c495156..897a182708 100644 --- a/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_acls_dir.rb +++ b/lib/chef/chef_fs/file_system/repository/acls_dir.rb @@ -25,7 +25,7 @@ class Chef module ChefFS module FileSystem module Repository - class ChefRepositoryFileSystemAclsDir < Repository::Directory + class AclsDir < Repository::Directory def can_have_child?(name, is_dir) is_dir ? Chef::ChefFS::FileSystem::ChefServer::AclsDir::ENTITY_TYPES.include?(name) : name == "organization.json" diff --git a/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_root_dir.rb b/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_root_dir.rb index 4457910317..263d1b2b09 100644 --- a/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_root_dir.rb +++ b/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_root_dir.rb @@ -17,7 +17,7 @@ # require "chef/chef_fs/file_system/base_fs_dir" -require "chef/chef_fs/file_system/repository/chef_repository_file_system_acls_dir" +require "chef/chef_fs/file_system/repository/acls_dir" require "chef/chef_fs/file_system/repository/clients_dir" require "chef/chef_fs/file_system/repository/cookbooks_dir" require "chef/chef_fs/file_system/repository/cookbook_artifacts_dir" @@ -29,9 +29,9 @@ require "chef/chef_fs/file_system/repository/nodes_dir" require "chef/chef_fs/file_system/repository/policy_groups_dir" require "chef/chef_fs/file_system/repository/roles_dir" require "chef/chef_fs/file_system/repository/users_dir" -require "chef/chef_fs/file_system/repository/chef_repository_file_system_client_keys_dir" +require "chef/chef_fs/file_system/repository/client_keys_dir" require "chef/chef_fs/file_system/repository/chef_repository_file_system_entry" -require "chef/chef_fs/file_system/repository/chef_repository_file_system_policies_dir" +require "chef/chef_fs/file_system/repository/policies_dir" require "chef/chef_fs/file_system/repository/versioned_cookbooks_dir" require "chef/chef_fs/file_system/multiplexed_dir" require "chef/chef_fs/data_handler/client_data_handler" @@ -175,9 +175,9 @@ class Chef end case name when "acls" - dirs = paths.map { |path| ChefRepositoryFileSystemAclsDir.new(name, self, path) } + dirs = paths.map { |path| AclsDir.new(name, self, path) } when "client_keys" - dirs = paths.map { |path| ChefRepositoryFileSystemClientKeysDir.new(name, self, path) } + dirs = paths.map { |path| ClientKeysDir.new(name, self, path) } when "clients" dirs = paths.map { |path| ClientsDir.new(name, self, path) } when "containers" @@ -201,7 +201,7 @@ class Chef when "policy_groups" dirs = paths.map { |path| PolicyGroupsDir.new(name, self, path) } when "policies" - dirs = paths.map { |path| ChefRepositoryFileSystemPoliciesDir.new(name, self, path) } + dirs = paths.map { |path| PoliciesDir.new(name, self, path) } when "roles" dirs = paths.map { |path| RolesDir.new(name, self, path) } when "users" diff --git a/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_client_keys_dir.rb b/lib/chef/chef_fs/file_system/repository/client_keys_dir.rb index 544f089096..0cdc25569e 100644 --- a/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_client_keys_dir.rb +++ b/lib/chef/chef_fs/file_system/repository/client_keys_dir.rb @@ -24,7 +24,7 @@ class Chef module ChefFS module FileSystem module Repository - class ChefRepositoryFileSystemClientKeysDir < ChefRepositoryFileSystemEntry + class ClientKeysDir < Repository::Directory def can_have_child?(name, is_dir) is_dir && !name.start_with?(".") diff --git a/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_policies_dir.rb b/lib/chef/chef_fs/file_system/repository/policies_dir.rb index b979e30dca..47a93f6655 100644 --- a/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_policies_dir.rb +++ b/lib/chef/chef_fs/file_system/repository/policies_dir.rb @@ -17,20 +17,24 @@ # require "chef/chef_fs/file_system/repository/chef_repository_file_system_entry" +require "chef/chef_fs/file_system/repository/directory" require "chef/chef_fs/data_handler/policy_data_handler" class Chef module ChefFS module FileSystem module Repository - class ChefRepositoryFileSystemPoliciesDir < ChefRepositoryFileSystemEntry - def initialize(name, parent, path = nil) - super(name, parent, path, Chef::ChefFS::DataHandler::PolicyDataHandler.new) - end + class PoliciesDir < Repository::Directory def can_have_child?(name, is_dir) !is_dir && name.include?("-") end + + protected + + def make_child_entry(child_name) + ChefRepositoryFileSystemEntry.new(child_name, self, nil, Chef::ChefFS::DataHandler::PolicyDataHandler.new) + end end end end |