diff options
author | Thom May <thom@may.lt> | 2016-04-14 17:36:11 +0100 |
---|---|---|
committer | Thom May <thom@may.lt> | 2016-04-14 17:36:11 +0100 |
commit | 5e262c06b91ea2d1d56dccdf9102fcf6c74abbc4 (patch) | |
tree | f80228db1af5a51d6c0a5bbe87d09ff237b0d257 | |
parent | ae09fbf015adac842aec21347d776d8c367c6698 (diff) | |
parent | 2d48106e6c6afa454ea7c7974de124e977b56112 (diff) | |
download | chef-5e262c06b91ea2d1d56dccdf9102fcf6c74abbc4.tar.gz |
Merge pull request #4830 from chef/tm/fs_dirs_2
Rename and add backcompat requires for ChefFS dirs
-rw-r--r-- | lib-backcompat/chef/chef_fs/file_system/already_exists_error.rb (renamed from lib/chef/chef_fs/file_system/already_exists_error.rb) | 0 | ||||
-rw-r--r-- | lib-backcompat/chef/chef_fs/file_system/cookbook_frozen_error.rb (renamed from lib/chef/chef_fs/file_system/cookbook_frozen_error.rb) | 0 | ||||
-rw-r--r-- | lib-backcompat/chef/chef_fs/file_system/default_environment_cannot_be_modified_error.rb (renamed from lib/chef/chef_fs/file_system/default_environment_cannot_be_modified_error.rb) | 0 | ||||
-rw-r--r-- | lib-backcompat/chef/chef_fs/file_system/file_system_error.rb (renamed from lib/chef/chef_fs/file_system/file_system_error.rb) | 0 | ||||
-rw-r--r-- | lib-backcompat/chef/chef_fs/file_system/must_delete_recursively_error.rb (renamed from lib/chef/chef_fs/file_system/must_delete_recursively_error.rb) | 0 | ||||
-rw-r--r-- | lib-backcompat/chef/chef_fs/file_system/not_found_error.rb (renamed from lib/chef/chef_fs/file_system/not_found_error.rb) | 0 | ||||
-rw-r--r-- | lib-backcompat/chef/chef_fs/file_system/operation_failed_error.rb (renamed from lib/chef/chef_fs/file_system/operation_failed_error.rb) | 0 | ||||
-rw-r--r-- | lib-backcompat/chef/chef_fs/file_system/operation_not_allowed_error.rb (renamed from lib/chef/chef_fs/file_system/operation_not_allowed_error.rb) | 0 | ||||
-rw-r--r-- | lib-backcompat/chef/chef_fs/file_system/repository/chef_repository_file_system_acls_dir.rb | 5 | ||||
-rw-r--r-- | lib-backcompat/chef/chef_fs/file_system/repository/chef_repository_file_system_client_keys_dir.rb | 5 | ||||
-rw-r--r-- | lib-backcompat/chef/chef_fs/file_system/repository/chef_repository_file_system_policies_dir.rb | 5 | ||||
-rw-r--r-- | lib-backcompat/chef/chef_fs/file_system/repository/file_system_root_dir.rb (renamed from lib/chef/chef_fs/file_system/repository/file_system_root_dir.rb) | 1 | ||||
-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 |
16 files changed, 32 insertions, 12 deletions
diff --git a/lib/chef/chef_fs/file_system/already_exists_error.rb b/lib-backcompat/chef/chef_fs/file_system/already_exists_error.rb index 6d9973e8a4..6d9973e8a4 100644 --- a/lib/chef/chef_fs/file_system/already_exists_error.rb +++ b/lib-backcompat/chef/chef_fs/file_system/already_exists_error.rb diff --git a/lib/chef/chef_fs/file_system/cookbook_frozen_error.rb b/lib-backcompat/chef/chef_fs/file_system/cookbook_frozen_error.rb index 6d9973e8a4..6d9973e8a4 100644 --- a/lib/chef/chef_fs/file_system/cookbook_frozen_error.rb +++ b/lib-backcompat/chef/chef_fs/file_system/cookbook_frozen_error.rb diff --git a/lib/chef/chef_fs/file_system/default_environment_cannot_be_modified_error.rb b/lib-backcompat/chef/chef_fs/file_system/default_environment_cannot_be_modified_error.rb index 6d9973e8a4..6d9973e8a4 100644 --- a/lib/chef/chef_fs/file_system/default_environment_cannot_be_modified_error.rb +++ b/lib-backcompat/chef/chef_fs/file_system/default_environment_cannot_be_modified_error.rb diff --git a/lib/chef/chef_fs/file_system/file_system_error.rb b/lib-backcompat/chef/chef_fs/file_system/file_system_error.rb index 6d9973e8a4..6d9973e8a4 100644 --- a/lib/chef/chef_fs/file_system/file_system_error.rb +++ b/lib-backcompat/chef/chef_fs/file_system/file_system_error.rb diff --git a/lib/chef/chef_fs/file_system/must_delete_recursively_error.rb b/lib-backcompat/chef/chef_fs/file_system/must_delete_recursively_error.rb index 6d9973e8a4..6d9973e8a4 100644 --- a/lib/chef/chef_fs/file_system/must_delete_recursively_error.rb +++ b/lib-backcompat/chef/chef_fs/file_system/must_delete_recursively_error.rb diff --git a/lib/chef/chef_fs/file_system/not_found_error.rb b/lib-backcompat/chef/chef_fs/file_system/not_found_error.rb index 6d9973e8a4..6d9973e8a4 100644 --- a/lib/chef/chef_fs/file_system/not_found_error.rb +++ b/lib-backcompat/chef/chef_fs/file_system/not_found_error.rb diff --git a/lib/chef/chef_fs/file_system/operation_failed_error.rb b/lib-backcompat/chef/chef_fs/file_system/operation_failed_error.rb index 6d9973e8a4..6d9973e8a4 100644 --- a/lib/chef/chef_fs/file_system/operation_failed_error.rb +++ b/lib-backcompat/chef/chef_fs/file_system/operation_failed_error.rb diff --git a/lib/chef/chef_fs/file_system/operation_not_allowed_error.rb b/lib-backcompat/chef/chef_fs/file_system/operation_not_allowed_error.rb index 6d9973e8a4..6d9973e8a4 100644 --- a/lib/chef/chef_fs/file_system/operation_not_allowed_error.rb +++ b/lib-backcompat/chef/chef_fs/file_system/operation_not_allowed_error.rb diff --git a/lib-backcompat/chef/chef_fs/file_system/repository/chef_repository_file_system_acls_dir.rb b/lib-backcompat/chef/chef_fs/file_system/repository/chef_repository_file_system_acls_dir.rb new file mode 100644 index 0000000000..d9bdbc104c --- /dev/null +++ b/lib-backcompat/chef/chef_fs/file_system/repository/chef_repository_file_system_acls_dir.rb @@ -0,0 +1,5 @@ +require "chef/chef_fs/file_system/repository/acls_dir" + +module Chef::ChefFS::FileSystem::Repository + ChefRepositoryFileSystemAclsDir = AclsDir +end diff --git a/lib-backcompat/chef/chef_fs/file_system/repository/chef_repository_file_system_client_keys_dir.rb b/lib-backcompat/chef/chef_fs/file_system/repository/chef_repository_file_system_client_keys_dir.rb new file mode 100644 index 0000000000..4ebcb5f010 --- /dev/null +++ b/lib-backcompat/chef/chef_fs/file_system/repository/chef_repository_file_system_client_keys_dir.rb @@ -0,0 +1,5 @@ +require "chef/chef_fs/file_system/repository/client_keys_dir" + +module Chef::ChefFS::FileSystem::Repository + ChefRepositoryFileSystemClientKeysDir = ClientKeysDir +end diff --git a/lib-backcompat/chef/chef_fs/file_system/repository/chef_repository_file_system_policies_dir.rb b/lib-backcompat/chef/chef_fs/file_system/repository/chef_repository_file_system_policies_dir.rb new file mode 100644 index 0000000000..393e4aa85d --- /dev/null +++ b/lib-backcompat/chef/chef_fs/file_system/repository/chef_repository_file_system_policies_dir.rb @@ -0,0 +1,5 @@ +require "chef/chef_fs/file_system/repository/policies_dir" + +module Chef::ChefFS::FileSystem::Repository + ChefRepositoryFileSystemPoliciesDir = PoliciesDir +end diff --git a/lib/chef/chef_fs/file_system/repository/file_system_root_dir.rb b/lib-backcompat/chef/chef_fs/file_system/repository/file_system_root_dir.rb index e2bb27cbc9..8565ee6029 100644 --- a/lib/chef/chef_fs/file_system/repository/file_system_root_dir.rb +++ b/lib-backcompat/chef/chef_fs/file_system/repository/file_system_root_dir.rb @@ -24,6 +24,7 @@ class Chef module Repository class FileSystemRootDir < FileSystemEntry def initialize(file_path) + Chef.log_deprecation "Chef::ChefFS::FileSystem::Repository::FileSystemRootDir is deprecated." super("", nil, file_path) end end 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 |