chef 12.6.0-universal-mingw32 → 12.7.2-universal-mingw32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +26 -19
- data/README.md +26 -23
- data/Rakefile +28 -17
- data/VERSION +1 -0
- data/acceptance/.gitignore +1 -0
- data/acceptance/.shared/kitchen_acceptance/.kitchen.digitalocean.yml +27 -0
- data/acceptance/.shared/kitchen_acceptance/.kitchen.ec2.yml +281 -0
- data/acceptance/.shared/kitchen_acceptance/.kitchen.vagrant.yml +49 -0
- data/acceptance/.shared/kitchen_acceptance/libraries/kitchen.rb +46 -0
- data/acceptance/.shared/kitchen_acceptance/metadata.rb +1 -0
- data/acceptance/Gemfile +11 -0
- data/acceptance/README.md +86 -0
- data/acceptance/basics/.acceptance/acceptance-cookbook/.gitignore +2 -0
- data/acceptance/basics/.acceptance/acceptance-cookbook/metadata.rb +3 -0
- data/acceptance/basics/.acceptance/acceptance-cookbook/recipes/destroy.rb +1 -0
- data/acceptance/basics/.acceptance/acceptance-cookbook/recipes/provision.rb +1 -0
- data/acceptance/basics/.acceptance/acceptance-cookbook/recipes/verify.rb +1 -0
- data/acceptance/basics/.kitchen.yml +4 -0
- data/acceptance/basics/test/integration/chef-current-install/serverspec/chef_client_spec.rb +19 -0
- data/acceptance/basics/test/integration/chef-current-install/serverspec/spec_helper.rb +6 -0
- data/acceptance/top-cookbooks/.acceptance/acceptance-cookbook/.gitignore +2 -0
- data/acceptance/top-cookbooks/.acceptance/acceptance-cookbook/libraries/cookbook_kitchen.rb +43 -0
- data/acceptance/top-cookbooks/.acceptance/acceptance-cookbook/libraries/top_cookbooks.rb +21 -0
- data/acceptance/top-cookbooks/.acceptance/acceptance-cookbook/metadata.rb +3 -0
- data/acceptance/top-cookbooks/.acceptance/acceptance-cookbook/recipes/destroy.rb +1 -0
- data/acceptance/top-cookbooks/.acceptance/acceptance-cookbook/recipes/provision.rb +1 -0
- data/acceptance/top-cookbooks/.acceptance/acceptance-cookbook/recipes/verify.rb +1 -0
- data/acceptance/top-cookbooks/.gitignore +1 -0
- data/acceptance/top-cookbooks/.kitchen.git.yml +10 -0
- data/acceptance/top-cookbooks/.kitchen.learn-the-basics-rhel.yml +4 -0
- data/acceptance/top-cookbooks/.kitchen.learn-the-basics-ubuntu.yml +4 -0
- data/acceptance/top-cookbooks/.kitchen.learn-the-basics-windows.yml +4 -0
- data/acceptance/trivial/.acceptance/acceptance-cookbook/.gitignore +2 -0
- data/acceptance/trivial/.acceptance/acceptance-cookbook/metadata.rb +2 -0
- data/acceptance/trivial/.acceptance/acceptance-cookbook/recipes/destroy.rb +1 -0
- data/acceptance/trivial/.acceptance/acceptance-cookbook/recipes/provision.rb +1 -0
- data/acceptance/trivial/.acceptance/acceptance-cookbook/recipes/verify.rb +1 -0
- data/acceptance/trivial/.kitchen.yml +7 -0
- data/acceptance/trivial/test/integration/chef-current-install/inspec/chef_client_spec.rb +5 -0
- data/acceptance/windows-service/.acceptance/acceptance-cookbook/.gitignore +2 -0
- data/acceptance/windows-service/.acceptance/acceptance-cookbook/metadata.rb +2 -0
- data/acceptance/windows-service/.acceptance/acceptance-cookbook/recipes/destroy.rb +1 -0
- data/acceptance/windows-service/.acceptance/acceptance-cookbook/recipes/provision.rb +1 -0
- data/acceptance/windows-service/.acceptance/acceptance-cookbook/recipes/verify.rb +1 -0
- data/acceptance/windows-service/.kitchen.yml +7 -0
- data/acceptance/windows-service/test/integration/chef-windows-service/inspec/chef_windows_service_spec.rb +58 -0
- data/bin/chef-apply +3 -3
- data/bin/chef-client +5 -5
- data/bin/chef-service-manager +7 -7
- data/bin/chef-shell +1 -1
- data/bin/chef-solo +4 -4
- data/bin/chef-windows-service +5 -5
- data/bin/knife +4 -5
- data/chef-windows.gemspec +5 -2
- data/chef.gemspec +13 -13
- data/distro/common/html/_static/basic.css +1 -1
- data/distro/common/html/_static/doctools.js +1 -1
- data/distro/common/html/_static/searchtools.js +1 -1
- data/distro/common/html/_static/websupport.js +1 -1
- data/ext/win32-eventlog/Rakefile +13 -14
- data/lib-backcompat/chef/chef_fs/file_system/acl_entry.rb +5 -0
- data/lib-backcompat/chef/chef_fs/file_system/chef_repository_file_system_root_dir.rb +5 -0
- data/lib-backcompat/chef/chef_fs/file_system/chef_server_root_dir.rb +5 -0
- data/lib/chef.rb +17 -17
- data/lib/chef/api_client.rb +31 -30
- data/lib/chef/api_client/registration.rb +34 -10
- data/lib/chef/api_client_v1.rb +36 -36
- data/lib/chef/application.rb +32 -23
- data/lib/chef/application/apply.rb +20 -20
- data/lib/chef/application/client.rb +63 -43
- data/lib/chef/application/knife.rb +21 -15
- data/lib/chef/application/solo.rb +52 -41
- data/lib/chef/application/windows_service.rb +25 -25
- data/lib/chef/application/windows_service_manager.rb +22 -22
- data/lib/chef/applications.rb +4 -4
- data/lib/chef/audit/audit_event_proxy.rb +3 -3
- data/lib/chef/audit/audit_reporter.rb +8 -10
- data/lib/chef/audit/control_group_data.rb +9 -10
- data/lib/chef/audit/logger.rb +3 -3
- data/lib/chef/audit/rspec_formatter.rb +2 -2
- data/lib/chef/audit/runner.rb +15 -14
- data/lib/chef/chef_class.rb +10 -7
- data/lib/chef/chef_fs.rb +51 -1
- data/lib/chef/chef_fs/chef_fs_data_store.rb +320 -125
- data/lib/chef/chef_fs/command_line.rb +8 -8
- data/lib/chef/chef_fs/config.rb +52 -23
- data/lib/chef/chef_fs/data_handler/acl_data_handler.rb +10 -10
- data/lib/chef/chef_fs/data_handler/client_data_handler.rb +12 -12
- data/lib/chef/chef_fs/data_handler/container_data_handler.rb +6 -6
- data/lib/chef/chef_fs/data_handler/cookbook_data_handler.rb +15 -15
- data/lib/chef/chef_fs/data_handler/data_bag_item_data_handler.rb +11 -11
- data/lib/chef/chef_fs/data_handler/data_handler_base.rb +8 -8
- data/lib/chef/chef_fs/data_handler/environment_data_handler.rb +14 -14
- data/lib/chef/chef_fs/data_handler/group_data_handler.rb +18 -18
- data/lib/chef/chef_fs/data_handler/node_data_handler.rb +14 -14
- data/lib/chef/chef_fs/data_handler/organization_data_handler.rb +9 -9
- data/lib/chef/chef_fs/data_handler/organization_invites_data_handler.rb +2 -2
- data/lib/chef/chef_fs/data_handler/organization_members_data_handler.rb +2 -2
- data/lib/chef/chef_fs/data_handler/policy_data_handler.rb +30 -3
- data/lib/chef/chef_fs/data_handler/policy_group_data_handler.rb +27 -0
- data/lib/chef/chef_fs/data_handler/role_data_handler.rb +16 -16
- data/lib/chef/chef_fs/data_handler/user_data_handler.rb +12 -12
- data/lib/chef/chef_fs/file_pattern.rb +25 -25
- data/lib/chef/chef_fs/file_system.rb +10 -10
- data/lib/chef/chef_fs/file_system/already_exists_error.rb +3 -6
- data/lib/chef/chef_fs/file_system/base_fs_dir.rb +4 -4
- data/lib/chef/chef_fs/file_system/base_fs_object.rb +8 -8
- data/lib/chef/chef_fs/file_system/chef_server/acl_dir.rb +65 -0
- data/lib/chef/chef_fs/file_system/chef_server/acl_entry.rb +60 -0
- data/lib/chef/chef_fs/file_system/chef_server/acls_dir.rb +75 -0
- data/lib/chef/chef_fs/file_system/chef_server/chef_server_root_dir.rb +196 -0
- data/lib/chef/chef_fs/file_system/{chef_repository_file_system_acls_dir.rb → chef_server/cookbook_artifact_dir.rb} +13 -12
- data/lib/chef/chef_fs/file_system/chef_server/cookbook_artifacts_dir.rb +102 -0
- data/lib/chef/chef_fs/file_system/chef_server/cookbook_dir.rb +222 -0
- data/lib/chef/chef_fs/file_system/chef_server/cookbook_file.rb +84 -0
- data/lib/chef/chef_fs/file_system/chef_server/cookbook_subdir.rb +61 -0
- data/lib/chef/chef_fs/file_system/chef_server/cookbooks_acl_dir.rb +42 -0
- data/lib/chef/chef_fs/file_system/chef_server/cookbooks_dir.rb +102 -0
- data/lib/chef/chef_fs/file_system/chef_server/data_bag_dir.rb +71 -0
- data/lib/chef/chef_fs/file_system/chef_server/data_bags_dir.rb +69 -0
- data/lib/chef/chef_fs/file_system/chef_server/environments_dir.rb +57 -0
- data/lib/chef/chef_fs/file_system/chef_server/nodes_dir.rb +53 -0
- data/lib/chef/chef_fs/file_system/chef_server/org_entry.rb +31 -0
- data/lib/chef/chef_fs/file_system/chef_server/organization_invites_entry.rb +61 -0
- data/lib/chef/chef_fs/file_system/chef_server/organization_members_entry.rb +60 -0
- data/lib/chef/chef_fs/file_system/chef_server/policies_acl_dir.rb +41 -0
- data/lib/chef/chef_fs/file_system/chef_server/policies_dir.rb +160 -0
- data/lib/chef/chef_fs/file_system/chef_server/policy_group_entry.rb +137 -0
- data/lib/chef/chef_fs/file_system/chef_server/policy_groups_dir.rb +43 -0
- data/lib/chef/chef_fs/file_system/chef_server/policy_revision_entry.rb +34 -0
- data/lib/chef/chef_fs/file_system/chef_server/rest_list_dir.rb +178 -0
- data/lib/chef/chef_fs/file_system/chef_server/rest_list_entry.rb +187 -0
- data/lib/chef/chef_fs/file_system/chef_server/versioned_cookbook_dir.rb +45 -0
- data/lib/chef/chef_fs/file_system/chef_server/versioned_cookbooks_dir.rb +107 -0
- data/lib/chef/chef_fs/file_system/cookbook_frozen_error.rb +3 -6
- data/lib/chef/chef_fs/file_system/default_environment_cannot_be_modified_error.rb +3 -7
- data/lib/chef/chef_fs/file_system/file_system_error.rb +14 -3
- data/lib/chef/chef_fs/file_system/memory/memory_dir.rb +53 -0
- data/lib/chef/chef_fs/file_system/memory/memory_file.rb +20 -0
- data/lib/chef/chef_fs/file_system/memory/memory_root.rb +23 -0
- data/lib/chef/chef_fs/file_system/multiplexed_dir.rb +2 -2
- data/lib/chef/chef_fs/file_system/must_delete_recursively_error.rb +3 -6
- data/lib/chef/chef_fs/file_system/nonexistent_fs_object.rb +4 -4
- data/lib/chef/chef_fs/file_system/not_found_error.rb +3 -6
- data/lib/chef/chef_fs/file_system/operation_failed_error.rb +5 -5
- data/lib/chef/chef_fs/file_system/operation_not_allowed_error.rb +16 -18
- data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_acls_dir.rb +39 -0
- data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_cookbook_artifact_dir.rb +41 -0
- data/lib/chef/chef_fs/file_system/{chef_repository_file_system_policies_dir.rb → repository/chef_repository_file_system_cookbook_artifacts_dir.rb} +9 -13
- data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_cookbook_dir.rb +95 -0
- data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_cookbook_entry.rb +82 -0
- data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_cookbooks_dir.rb +84 -0
- data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_data_bags_dir.rb +38 -0
- data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_entry.rb +83 -0
- data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_policies_dir.rb +38 -0
- data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_root_dir.rb +210 -0
- data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_versioned_cookbook_dir.rb +42 -0
- data/lib/chef/chef_fs/file_system/{chef_repository_file_system_data_bags_dir.rb → repository/chef_repository_file_system_versioned_cookbooks_dir.rb} +9 -11
- data/lib/chef/chef_fs/file_system/repository/file_system_entry.rb +117 -0
- data/lib/chef/chef_fs/file_system/{file_system_root_dir.rb → repository/file_system_root_dir.rb} +8 -6
- data/lib/chef/chef_fs/knife.rb +16 -16
- data/lib/chef/chef_fs/parallelizer.rb +3 -3
- data/lib/chef/chef_fs/parallelizer/flatten_enumerable.rb +1 -1
- data/lib/chef/chef_fs/parallelizer/parallel_enumerable.rb +3 -3
- data/lib/chef/chef_fs/path_utils.rb +11 -10
- data/lib/chef/client.rb +80 -71
- data/lib/chef/config.rb +10 -10
- data/lib/chef/config_fetcher.rb +12 -4
- data/lib/chef/constants.rb +2 -1
- data/lib/chef/cookbook/chefignore.rb +4 -5
- data/lib/chef/cookbook/cookbook_collection.rb +6 -6
- data/lib/chef/cookbook/cookbook_version_loader.rb +15 -15
- data/lib/chef/cookbook/file_system_file_vendor.rb +4 -4
- data/lib/chef/cookbook/file_vendor.rb +3 -4
- data/lib/chef/cookbook/metadata.rb +108 -107
- data/lib/chef/cookbook/remote_file_vendor.rb +7 -7
- data/lib/chef/cookbook/synchronizer.rb +11 -10
- data/lib/chef/cookbook/syntax_check.rb +14 -14
- data/lib/chef/cookbook_loader.rb +14 -14
- data/lib/chef/cookbook_manifest.rb +16 -15
- data/lib/chef/cookbook_site_streaming_uploader.rb +22 -22
- data/lib/chef/cookbook_uploader.rb +22 -21
- data/lib/chef/cookbook_version.rb +87 -87
- data/lib/chef/daemon.rb +6 -6
- data/lib/chef/data_bag.rb +32 -26
- data/lib/chef/data_bag_item.rb +43 -40
- data/lib/chef/delayed_evaluator.rb +1 -1
- data/lib/chef/deprecation/mixin/template.rb +4 -4
- data/lib/chef/deprecation/provider/cookbook_file.rb +2 -3
- data/lib/chef/deprecation/provider/file.rb +10 -10
- data/lib/chef/deprecation/provider/remote_directory.rb +5 -5
- data/lib/chef/deprecation/provider/remote_file.rb +3 -3
- data/lib/chef/deprecation/provider/template.rb +3 -3
- data/lib/chef/deprecation/warnings.rb +2 -2
- data/lib/chef/digester.rb +6 -6
- data/lib/chef/dsl.rb +6 -6
- data/lib/chef/dsl/audit.rb +4 -4
- data/lib/chef/dsl/chef_provisioning.rb +5 -5
- data/lib/chef/dsl/cheffish.rb +5 -5
- data/lib/chef/dsl/data_query.rb +10 -10
- data/lib/chef/dsl/declare_resource.rb +8 -8
- data/lib/chef/dsl/definitions.rb +1 -2
- data/lib/chef/dsl/include_attribute.rb +4 -6
- data/lib/chef/dsl/include_recipe.rb +4 -4
- data/lib/chef/dsl/platform_introspection.rb +8 -14
- data/lib/chef/dsl/powershell.rb +3 -3
- data/lib/chef/dsl/reboot_pending.rb +12 -13
- data/lib/chef/dsl/recipe.rb +20 -20
- data/lib/chef/dsl/registry_helper.rb +7 -3
- data/lib/chef/dsl/resources.rb +6 -5
- data/lib/chef/encrypted_data_bag_item.rb +10 -10
- data/lib/chef/encrypted_data_bag_item/assertions.rb +4 -4
- data/lib/chef/encrypted_data_bag_item/check_encrypted.rb +3 -3
- data/lib/chef/encrypted_data_bag_item/decryption_failure.rb +2 -2
- data/lib/chef/encrypted_data_bag_item/decryptor.rb +16 -14
- data/lib/chef/encrypted_data_bag_item/encrypted_data_bag_item_assertions.rb +1 -1
- data/lib/chef/encrypted_data_bag_item/encryption_failure.rb +1 -1
- data/lib/chef/encrypted_data_bag_item/encryptor.rb +20 -20
- data/lib/chef/encrypted_data_bag_item/unacceptable_encrypted_data_bag_item_format.rb +2 -2
- data/lib/chef/encrypted_data_bag_item/unsupported_cipher.rb +2 -2
- data/lib/chef/encrypted_data_bag_item/unsupported_encrypted_data_bag_item_format.rb +2 -2
- data/lib/chef/environment.rb +41 -34
- data/lib/chef/event_dispatch/base.rb +2 -2
- data/lib/chef/event_dispatch/dispatcher.rb +2 -2
- data/lib/chef/event_dispatch/dsl.rb +6 -5
- data/lib/chef/event_loggers/base.rb +3 -3
- data/lib/chef/event_loggers/windows_eventlog.rb +11 -11
- data/lib/chef/exceptions.rb +23 -34
- data/lib/chef/file_access_control.rb +6 -6
- data/lib/chef/file_access_control/unix.rb +5 -5
- data/lib/chef/file_access_control/windows.rb +5 -5
- data/lib/chef/file_cache.rb +21 -21
- data/lib/chef/file_content_management/content_base.rb +2 -2
- data/lib/chef/file_content_management/deploy.rb +5 -6
- data/lib/chef/file_content_management/deploy/cp.rb +2 -2
- data/lib/chef/file_content_management/deploy/mv_unix.rb +2 -3
- data/lib/chef/file_content_management/deploy/mv_windows.rb +4 -6
- data/lib/chef/file_content_management/tempfile.rb +3 -3
- data/lib/chef/formatters/base.rb +8 -9
- data/lib/chef/formatters/doc.rb +7 -7
- data/lib/chef/formatters/error_descriptor.rb +5 -5
- data/lib/chef/formatters/error_inspectors.rb +5 -5
- data/lib/chef/formatters/error_inspectors/api_error_formatting.rb +50 -15
- data/lib/chef/formatters/error_inspectors/compile_error_inspector.rb +11 -11
- data/lib/chef/formatters/error_inspectors/cookbook_resolve_error_inspector.rb +8 -8
- data/lib/chef/formatters/error_inspectors/cookbook_sync_error_inspector.rb +8 -6
- data/lib/chef/formatters/error_inspectors/node_load_error_inspector.rb +14 -13
- data/lib/chef/formatters/error_inspectors/registration_error_inspector.rb +19 -17
- data/lib/chef/formatters/error_inspectors/resource_failure_inspector.rb +8 -11
- data/lib/chef/formatters/error_inspectors/run_list_expansion_error_inspector.rb +15 -14
- data/lib/chef/formatters/error_mapper.rb +2 -2
- data/lib/chef/formatters/indentable_output_stream.rb +5 -5
- data/lib/chef/formatters/minimal.rb +7 -9
- data/lib/chef/guard_interpreter.rb +3 -3
- data/lib/chef/guard_interpreter/default_guard_interpreter.rb +3 -4
- data/lib/chef/guard_interpreter/resource_guard_interpreter.rb +9 -9
- data/lib/chef/handler.rb +4 -4
- data/lib/chef/handler/error_report.rb +4 -4
- data/lib/chef/handler/json_file.rb +5 -5
- data/lib/chef/http.rb +32 -35
- data/lib/chef/http/auth_credentials.rb +12 -12
- data/lib/chef/http/authenticator.rb +17 -12
- data/lib/chef/http/basic_client.rb +20 -20
- data/lib/chef/http/cookie_jar.rb +7 -7
- data/lib/chef/http/cookie_manager.rb +8 -8
- data/lib/chef/http/decompressor.rb +7 -9
- data/lib/chef/http/http_request.rb +31 -32
- data/lib/chef/http/json_input.rb +9 -9
- data/lib/chef/http/json_output.rb +9 -9
- data/lib/chef/http/json_to_model_output.rb +4 -4
- data/lib/chef/http/remote_request_id.rb +6 -6
- data/lib/chef/http/simple.rb +23 -5
- data/lib/chef/http/simple_json.rb +43 -0
- data/lib/chef/http/socketless_chef_zero_client.rb +56 -57
- data/lib/chef/http/ssl_policies.rb +9 -9
- data/lib/chef/http/validate_content_length.rb +12 -12
- data/lib/chef/json_compat.rb +6 -6
- data/lib/chef/key.rb +44 -42
- data/lib/chef/knife.rb +47 -44
- data/lib/chef/knife/bootstrap.rb +32 -32
- data/lib/chef/knife/bootstrap/chef_vault_handler.rb +16 -23
- data/lib/chef/knife/bootstrap/client_builder.rb +15 -13
- data/lib/chef/knife/bootstrap/templates/chef-full.erb +1 -1
- data/lib/chef/knife/client_bulk_delete.rb +5 -5
- data/lib/chef/knife/client_create.rb +5 -5
- data/lib/chef/knife/client_delete.rb +6 -6
- data/lib/chef/knife/client_edit.rb +5 -5
- data/lib/chef/knife/client_key_create.rb +6 -6
- data/lib/chef/knife/client_key_delete.rb +6 -6
- data/lib/chef/knife/client_key_edit.rb +8 -9
- data/lib/chef/knife/client_key_list.rb +5 -5
- data/lib/chef/knife/client_key_show.rb +5 -5
- data/lib/chef/knife/client_list.rb +5 -5
- data/lib/chef/knife/client_reregister.rb +5 -5
- data/lib/chef/knife/client_show.rb +5 -5
- data/lib/chef/knife/configure.rb +14 -14
- data/lib/chef/knife/configure_client.rb +6 -6
- data/lib/chef/knife/cookbook_bulk_delete.rb +9 -10
- data/lib/chef/knife/cookbook_create.rb +12 -12
- data/lib/chef/knife/cookbook_delete.rb +10 -10
- data/lib/chef/knife/cookbook_download.rb +8 -10
- data/lib/chef/knife/cookbook_list.rb +5 -5
- data/lib/chef/knife/cookbook_metadata.rb +8 -8
- data/lib/chef/knife/cookbook_metadata_from_file.rb +5 -5
- data/lib/chef/knife/cookbook_show.rb +14 -18
- data/lib/chef/knife/cookbook_site_download.rb +22 -22
- data/lib/chef/knife/cookbook_site_install.rb +10 -10
- data/lib/chef/knife/cookbook_site_list.rb +6 -10
- data/lib/chef/knife/cookbook_site_search.rb +5 -10
- data/lib/chef/knife/cookbook_site_share.rb +17 -18
- data/lib/chef/knife/cookbook_site_show.rb +7 -12
- data/lib/chef/knife/cookbook_site_unshare.rb +6 -6
- data/lib/chef/knife/cookbook_site_vendor.rb +5 -5
- data/lib/chef/knife/cookbook_test.rb +6 -7
- data/lib/chef/knife/cookbook_upload.rb +19 -20
- data/lib/chef/knife/core/bootstrap_context.rb +25 -21
- data/lib/chef/knife/core/cookbook_scm_repo.rb +11 -12
- data/lib/chef/knife/core/custom_manifest_loader.rb +2 -2
- data/lib/chef/knife/core/gem_glob_loader.rb +11 -11
- data/lib/chef/knife/core/generic_presenter.rb +33 -34
- data/lib/chef/knife/core/hashed_command_loader.rb +6 -6
- data/lib/chef/knife/core/node_editor.rb +59 -38
- data/lib/chef/knife/core/node_presenter.rb +13 -14
- data/lib/chef/knife/core/object_loader.rb +9 -9
- data/lib/chef/knife/core/status_presenter.rb +17 -17
- data/lib/chef/knife/core/subcommand_loader.rb +19 -20
- data/lib/chef/knife/core/text_formatter.rb +13 -14
- data/lib/chef/knife/core/ui.rb +17 -18
- data/lib/chef/knife/data_bag_create.rb +11 -10
- data/lib/chef/knife/data_bag_delete.rb +6 -8
- data/lib/chef/knife/data_bag_edit.rb +8 -11
- data/lib/chef/knife/data_bag_from_file.rb +12 -11
- data/lib/chef/knife/data_bag_list.rb +4 -8
- data/lib/chef/knife/data_bag_secret_options.rb +6 -6
- data/lib/chef/knife/data_bag_show.rb +31 -31
- data/lib/chef/knife/delete.rb +6 -7
- data/lib/chef/knife/deps.rb +18 -18
- data/lib/chef/knife/diff.rb +8 -9
- data/lib/chef/knife/download.rb +11 -12
- data/lib/chef/knife/edit.rb +5 -6
- data/lib/chef/knife/environment_compare.rb +23 -23
- data/lib/chef/knife/environment_create.rb +5 -5
- data/lib/chef/knife/environment_delete.rb +5 -5
- data/lib/chef/knife/environment_edit.rb +5 -5
- data/lib/chef/knife/environment_from_file.rb +4 -5
- data/lib/chef/knife/environment_list.rb +5 -5
- data/lib/chef/knife/environment_show.rb +5 -5
- data/lib/chef/knife/exec.rb +7 -7
- data/lib/chef/knife/help.rb +7 -9
- data/lib/chef/knife/index_rebuild.rb +4 -5
- data/lib/chef/knife/key_create.rb +5 -5
- data/lib/chef/knife/key_create_base.rb +1 -1
- data/lib/chef/knife/key_delete.rb +2 -2
- data/lib/chef/knife/key_edit.rb +5 -5
- data/lib/chef/knife/key_edit_base.rb +1 -1
- data/lib/chef/knife/key_list.rb +12 -12
- data/lib/chef/knife/key_list_base.rb +1 -1
- data/lib/chef/knife/key_show.rb +4 -4
- data/lib/chef/knife/list.rb +14 -13
- data/lib/chef/knife/node_bulk_delete.rb +6 -12
- data/lib/chef/knife/node_create.rb +5 -8
- data/lib/chef/knife/node_delete.rb +5 -6
- data/lib/chef/knife/node_edit.rb +6 -8
- data/lib/chef/knife/node_environment_set.rb +4 -4
- data/lib/chef/knife/node_from_file.rb +10 -10
- data/lib/chef/knife/node_list.rb +5 -7
- data/lib/chef/knife/node_run_list_add.rb +8 -8
- data/lib/chef/knife/node_run_list_remove.rb +8 -8
- data/lib/chef/knife/node_run_list_set.rb +6 -6
- data/lib/chef/knife/node_show.rb +6 -7
- data/lib/chef/knife/osc_user_create.rb +5 -5
- data/lib/chef/knife/osc_user_delete.rb +5 -5
- data/lib/chef/knife/osc_user_edit.rb +5 -5
- data/lib/chef/knife/osc_user_list.rb +5 -5
- data/lib/chef/knife/osc_user_reregister.rb +5 -5
- data/lib/chef/knife/osc_user_show.rb +5 -5
- data/lib/chef/knife/raw.rb +18 -17
- data/lib/chef/knife/recipe_list.rb +4 -4
- data/lib/chef/knife/rehash.rb +9 -9
- data/lib/chef/knife/role_bulk_delete.rb +5 -10
- data/lib/chef/knife/role_create.rb +5 -7
- data/lib/chef/knife/role_delete.rb +5 -6
- data/lib/chef/knife/role_edit.rb +5 -8
- data/lib/chef/knife/role_env_run_list_add.rb +9 -9
- data/lib/chef/knife/role_env_run_list_clear.rb +4 -4
- data/lib/chef/knife/role_env_run_list_remove.rb +13 -13
- data/lib/chef/knife/role_env_run_list_replace.rb +6 -6
- data/lib/chef/knife/role_env_run_list_set.rb +6 -6
- data/lib/chef/knife/role_from_file.rb +6 -11
- data/lib/chef/knife/role_list.rb +5 -6
- data/lib/chef/knife/role_run_list_add.rb +9 -9
- data/lib/chef/knife/role_run_list_clear.rb +4 -4
- data/lib/chef/knife/role_run_list_remove.rb +13 -13
- data/lib/chef/knife/role_run_list_replace.rb +6 -6
- data/lib/chef/knife/role_run_list_set.rb +6 -6
- data/lib/chef/knife/role_show.rb +5 -8
- data/lib/chef/knife/search.rb +11 -11
- data/lib/chef/knife/serve.rb +10 -10
- data/lib/chef/knife/show.rb +4 -4
- data/lib/chef/knife/ssh.rb +34 -34
- data/lib/chef/knife/ssl_check.rb +12 -11
- data/lib/chef/knife/ssl_fetch.rb +13 -15
- data/lib/chef/knife/status.rb +10 -10
- data/lib/chef/knife/tag_create.rb +5 -5
- data/lib/chef/knife/tag_delete.rb +5 -5
- data/lib/chef/knife/tag_list.rb +5 -5
- data/lib/chef/knife/upload.rb +10 -11
- data/lib/chef/knife/user_create.rb +6 -8
- data/lib/chef/knife/user_delete.rb +6 -7
- data/lib/chef/knife/user_edit.rb +6 -7
- data/lib/chef/knife/user_key_create.rb +7 -7
- data/lib/chef/knife/user_key_delete.rb +6 -6
- data/lib/chef/knife/user_key_edit.rb +8 -9
- data/lib/chef/knife/user_key_list.rb +5 -5
- data/lib/chef/knife/user_key_show.rb +5 -5
- data/lib/chef/knife/user_list.rb +5 -5
- data/lib/chef/knife/user_reregister.rb +6 -7
- data/lib/chef/knife/user_show.rb +6 -6
- data/lib/chef/knife/xargs.rb +22 -23
- data/lib/chef/local_mode.rb +13 -11
- data/lib/chef/log.rb +10 -10
- data/lib/chef/log/syslog.rb +5 -6
- data/lib/chef/log/winevt.rb +12 -12
- data/lib/chef/mash.rb +6 -5
- data/lib/chef/mixin/api_version_request_handling.rb +1 -1
- data/lib/chef/mixin/checksum.rb +4 -4
- data/lib/chef/mixin/command.rb +13 -13
- data/lib/chef/mixin/command/unix.rb +7 -7
- data/lib/chef/mixin/command/windows.rb +6 -7
- data/lib/chef/mixin/convert_to_class_name.rb +11 -11
- data/lib/chef/mixin/create_path.rb +3 -3
- data/lib/chef/mixin/deep_merge.rb +3 -3
- data/lib/chef/mixin/deprecation.rb +24 -25
- data/lib/chef/mixin/descendants_tracker.rb +2 -3
- data/lib/chef/mixin/enforce_ownership_and_permissions.rb +3 -3
- data/lib/chef/mixin/file_class.rb +9 -11
- data/lib/chef/mixin/from_file.rb +3 -3
- data/lib/chef/mixin/get_source_from_package.rb +2 -3
- data/lib/chef/mixin/homebrew_user.rb +6 -6
- data/lib/chef/mixin/language.rb +5 -5
- data/lib/chef/mixin/language_include_attribute.rb +4 -5
- data/lib/chef/mixin/language_include_recipe.rb +4 -5
- data/lib/chef/mixin/params_validate.rb +38 -18
- data/lib/chef/mixin/path_sanity.rb +7 -7
- data/lib/chef/mixin/powershell_out.rb +5 -5
- data/lib/chef/mixin/powershell_type_coercions.rb +12 -10
- data/lib/chef/mixin/properties.rb +8 -8
- data/lib/chef/mixin/provides.rb +2 -2
- data/lib/chef/mixin/proxified_socket.rb +4 -4
- data/lib/chef/mixin/recipe_definition_dsl_core.rb +4 -4
- data/lib/chef/mixin/securable.rb +24 -27
- data/lib/chef/mixin/shell_out.rb +10 -10
- data/lib/chef/mixin/subclass_directive.rb +2 -2
- data/lib/chef/mixin/template.rb +8 -9
- data/lib/chef/mixin/unformatter.rb +1 -1
- data/lib/chef/mixin/uris.rb +2 -3
- data/lib/chef/mixin/which.rb +3 -3
- data/lib/chef/mixin/why_run.rb +6 -7
- data/lib/chef/mixin/wide_string.rb +7 -7
- data/lib/chef/mixin/windows_architecture_helper.rb +9 -10
- data/lib/chef/mixin/windows_env_helper.rb +10 -11
- data/lib/chef/mixin/xml_escape.rb +13 -13
- data/lib/chef/mixins.rb +13 -14
- data/lib/chef/monkey_patches/net-ssh-multi.rb +6 -6
- data/lib/chef/monkey_patches/net_http.rb +2 -2
- data/lib/chef/monkey_patches/webrick-utils.rb +6 -6
- data/lib/chef/monkey_patches/win32/registry.rb +6 -6
- data/lib/chef/monologger.rb +2 -4
- data/lib/chef/node.rb +66 -60
- data/lib/chef/node/attribute.rb +289 -289
- data/lib/chef/node/attribute_collections.rb +8 -8
- data/lib/chef/node/immutable_collections.rb +3 -3
- data/lib/chef/node_map.rb +11 -11
- data/lib/chef/null_logger.rb +3 -3
- data/lib/chef/org.rb +31 -30
- data/lib/chef/platform.rb +4 -4
- data/lib/chef/platform/handler_map.rb +2 -2
- data/lib/chef/platform/priority_map.rb +2 -2
- data/lib/chef/platform/provider_handler_map.rb +3 -3
- data/lib/chef/platform/provider_mapping.rb +33 -33
- data/lib/chef/platform/provider_priority_map.rb +2 -2
- data/lib/chef/platform/query_helpers.rb +10 -11
- data/lib/chef/platform/rebooter.rb +11 -11
- data/lib/chef/platform/resource_handler_map.rb +3 -3
- data/lib/chef/platform/resource_priority_map.rb +2 -2
- data/lib/chef/platform/service_helpers.rb +5 -5
- data/lib/chef/policy_builder.rb +5 -5
- data/lib/chef/policy_builder/dynamic.rb +10 -11
- data/lib/chef/policy_builder/expand_node_object.rb +24 -19
- data/lib/chef/policy_builder/policyfile.rb +13 -14
- data/lib/chef/property.rb +115 -49
- data/lib/chef/provider.rb +43 -43
- data/lib/chef/provider/apt_update.rb +79 -0
- data/lib/chef/provider/batch.rb +6 -6
- data/lib/chef/provider/breakpoint.rb +1 -1
- data/lib/chef/provider/cookbook_file.rb +5 -5
- data/lib/chef/provider/cookbook_file/content.rb +4 -4
- data/lib/chef/provider/cron.rb +8 -8
- data/lib/chef/provider/cron/aix.rb +1 -1
- data/lib/chef/provider/cron/solaris.rb +1 -1
- data/lib/chef/provider/cron/unix.rb +7 -7
- data/lib/chef/provider/deploy.rb +7 -8
- data/lib/chef/provider/deploy/revision.rb +9 -9
- data/lib/chef/provider/deploy/timestamped.rb +1 -1
- data/lib/chef/provider/directory.rb +8 -8
- data/lib/chef/provider/dsc_resource.rb +33 -27
- data/lib/chef/provider/dsc_script.rb +17 -17
- data/lib/chef/provider/env.rb +8 -8
- data/lib/chef/provider/env/windows.rb +3 -3
- data/lib/chef/provider/erl_call.rb +5 -5
- data/lib/chef/provider/execute.rb +8 -8
- data/lib/chef/provider/file.rb +24 -24
- data/lib/chef/provider/file/content.rb +4 -4
- data/lib/chef/provider/git.rb +33 -35
- data/lib/chef/provider/group.rb +7 -7
- data/lib/chef/provider/group/aix.rb +6 -6
- data/lib/chef/provider/group/dscl.rb +11 -11
- data/lib/chef/provider/group/gpasswd.rb +3 -3
- data/lib/chef/provider/group/groupadd.rb +8 -8
- data/lib/chef/provider/group/groupmod.rb +3 -3
- data/lib/chef/provider/group/pw.rb +2 -2
- data/lib/chef/provider/group/suse.rb +5 -5
- data/lib/chef/provider/group/usermod.rb +8 -8
- data/lib/chef/provider/group/windows.rb +5 -5
- data/lib/chef/provider/http_request.rb +15 -15
- data/lib/chef/provider/ifconfig.rb +15 -14
- data/lib/chef/provider/ifconfig/aix.rb +5 -4
- data/lib/chef/provider/ifconfig/debian.rb +6 -6
- data/lib/chef/provider/ifconfig/redhat.rb +3 -3
- data/lib/chef/provider/link.rb +13 -13
- data/lib/chef/provider/log.rb +1 -1
- data/lib/chef/provider/lwrp_base.rb +8 -8
- data/lib/chef/provider/mdadm.rb +4 -4
- data/lib/chef/provider/mount.rb +13 -13
- data/lib/chef/provider/mount/aix.rb +14 -14
- data/lib/chef/provider/mount/mount.rb +18 -18
- data/lib/chef/provider/mount/solaris.rb +30 -30
- data/lib/chef/provider/mount/windows.rb +4 -4
- data/lib/chef/provider/ohai.rb +2 -2
- data/lib/chef/provider/osx_profile.rb +256 -0
- data/lib/chef/provider/package.rb +19 -19
- data/lib/chef/provider/package/aix.rb +8 -9
- data/lib/chef/provider/package/apt.rb +12 -12
- data/lib/chef/provider/package/chocolatey.rb +277 -0
- data/lib/chef/provider/package/dpkg.rb +7 -7
- data/lib/chef/provider/package/easy_install.rb +14 -15
- data/lib/chef/provider/package/freebsd/base.rb +7 -7
- data/lib/chef/provider/package/freebsd/pkg.rb +8 -8
- data/lib/chef/provider/package/freebsd/pkgng.rb +6 -6
- data/lib/chef/provider/package/freebsd/port.rb +4 -4
- data/lib/chef/provider/package/homebrew.rb +16 -16
- data/lib/chef/provider/package/ips.rb +8 -8
- data/lib/chef/provider/package/macports.rb +1 -0
- data/lib/chef/provider/package/openbsd.rb +13 -13
- data/lib/chef/provider/package/pacman.rb +6 -9
- data/lib/chef/provider/package/paludis.rb +7 -10
- data/lib/chef/provider/package/portage.rb +10 -13
- data/lib/chef/provider/package/rpm.rb +7 -8
- data/lib/chef/provider/package/rubygems.rb +64 -64
- data/lib/chef/provider/package/smartos.rb +7 -10
- data/lib/chef/provider/package/solaris.rb +6 -11
- data/lib/chef/provider/package/windows.rb +38 -29
- data/lib/chef/provider/package/windows/exe.rb +9 -21
- data/lib/chef/provider/package/windows/msi.rb +12 -12
- data/lib/chef/provider/package/windows/registry_uninstall_entry.rb +7 -7
- data/lib/chef/provider/package/yum-dump.py +1 -1
- data/lib/chef/provider/package/yum.rb +43 -44
- data/lib/chef/provider/package/zypper.rb +57 -47
- data/lib/chef/provider/powershell_script.rb +14 -14
- data/lib/chef/provider/reboot.rb +5 -5
- data/lib/chef/provider/registry_key.rb +16 -16
- data/lib/chef/provider/remote_directory.rb +15 -15
- data/lib/chef/provider/remote_file.rb +5 -5
- data/lib/chef/provider/remote_file/cache_control_data.rb +11 -12
- data/lib/chef/provider/remote_file/content.rb +11 -11
- data/lib/chef/provider/remote_file/fetcher.rb +2 -2
- data/lib/chef/provider/remote_file/ftp.rb +11 -11
- data/lib/chef/provider/remote_file/http.rb +9 -9
- data/lib/chef/provider/remote_file/local_file.rb +5 -5
- data/lib/chef/provider/remote_file/network_file.rb +4 -4
- data/lib/chef/provider/route.rb +188 -188
- data/lib/chef/provider/ruby_block.rb +3 -3
- data/lib/chef/provider/script.rb +5 -5
- data/lib/chef/provider/service.rb +30 -30
- data/lib/chef/provider/service/aix.rb +4 -4
- data/lib/chef/provider/service/aixinit.rb +12 -12
- data/lib/chef/provider/service/arch.rb +5 -5
- data/lib/chef/provider/service/debian.rb +12 -13
- data/lib/chef/provider/service/freebsd.rb +7 -7
- data/lib/chef/provider/service/gentoo.rb +5 -5
- data/lib/chef/provider/service/init.rb +4 -4
- data/lib/chef/provider/service/insserv.rb +4 -4
- data/lib/chef/provider/service/invokercd.rb +3 -3
- data/lib/chef/provider/service/macosx.rb +19 -19
- data/lib/chef/provider/service/openbsd.rb +14 -14
- data/lib/chef/provider/service/redhat.rb +6 -6
- data/lib/chef/provider/service/simple.rb +10 -9
- data/lib/chef/provider/service/solaris.rb +8 -8
- data/lib/chef/provider/service/systemd.rb +4 -4
- data/lib/chef/provider/service/upstart.rb +8 -8
- data/lib/chef/provider/service/windows.rb +32 -78
- data/lib/chef/provider/subversion.rb +13 -13
- data/lib/chef/provider/template.rb +7 -7
- data/lib/chef/provider/template/content.rb +4 -4
- data/lib/chef/provider/template_finder.rb +2 -1
- data/lib/chef/provider/user.rb +9 -10
- data/lib/chef/provider/user/aix.rb +4 -3
- data/lib/chef/provider/user/dscl.rb +39 -40
- data/lib/chef/provider/user/pw.rb +9 -9
- data/lib/chef/provider/user/solaris.rb +9 -9
- data/lib/chef/provider/user/useradd.rb +9 -9
- data/lib/chef/provider/user/windows.rb +13 -13
- data/lib/chef/provider/whyrun_safe_ruby_block.rb +1 -1
- data/lib/chef/provider/windows_script.rb +5 -5
- data/lib/chef/provider_resolver.rb +3 -3
- data/lib/chef/providers.rb +113 -110
- data/lib/chef/recipe.rb +13 -14
- data/lib/chef/request_id.rb +4 -4
- data/lib/chef/resource.rb +103 -93
- data/lib/chef/resource/action_class.rb +3 -3
- data/lib/chef/resource/apt_package.rb +6 -17
- data/lib/chef/{shell/shell_rest.rb → resource/apt_update.rb} +14 -9
- data/lib/chef/resource/bash.rb +5 -5
- data/lib/chef/resource/batch.rb +4 -4
- data/lib/chef/resource/bff_package.rb +3 -3
- data/lib/chef/resource/breakpoint.rb +3 -4
- data/lib/chef/resource/chef_gem.rb +9 -25
- data/lib/chef/resource/chocolatey_package.rb +39 -0
- data/lib/chef/resource/conditional.rb +8 -8
- data/lib/chef/resource/conditional_action_not_nothing.rb +1 -1
- data/lib/chef/resource/cookbook_file.rb +10 -10
- data/lib/chef/resource/cron.rb +33 -33
- data/lib/chef/resource/csh.rb +5 -5
- data/lib/chef/resource/deploy.rb +76 -76
- data/lib/chef/resource/deploy_revision.rb +1 -1
- data/lib/chef/resource/directory.rb +12 -12
- data/lib/chef/resource/dpkg_package.rb +5 -6
- data/lib/chef/resource/dsc_resource.rb +121 -120
- data/lib/chef/resource/dsc_script.rb +25 -25
- data/lib/chef/resource/easy_install_package.rb +6 -25
- data/lib/chef/resource/env.rb +9 -9
- data/lib/chef/resource/erl_call.rb +15 -15
- data/lib/chef/resource/execute.rb +28 -28
- data/lib/chef/resource/file.rb +20 -87
- data/lib/chef/resource/file/verification.rb +11 -11
- data/lib/chef/resource/freebsd_package.rb +10 -9
- data/lib/chef/resource/gem_package.rb +8 -23
- data/lib/chef/resource/git.rb +4 -4
- data/lib/chef/resource/group.rb +18 -19
- data/lib/chef/resource/homebrew_package.rb +7 -18
- data/lib/chef/resource/http_request.rb +12 -12
- data/lib/chef/resource/ifconfig.rb +28 -28
- data/lib/chef/resource/ips_package.rb +5 -16
- data/lib/chef/resource/ksh.rb +3 -3
- data/lib/chef/resource/link.rb +18 -17
- data/lib/chef/resource/log.rb +9 -9
- data/lib/chef/resource/lwrp_base.rb +10 -10
- data/lib/chef/resource/macosx_service.rb +7 -7
- data/lib/chef/resource/macports_package.rb +3 -2
- data/lib/chef/resource/mdadm.rb +18 -19
- data/lib/chef/resource/mount.rb +34 -34
- data/lib/chef/resource/ohai.rb +7 -7
- data/lib/chef/resource/openbsd_package.rb +7 -6
- data/lib/chef/resource/osx_profile.rb +74 -0
- data/lib/chef/resource/package.rb +15 -69
- data/lib/chef/resource/pacman_package.rb +3 -2
- data/lib/chef/resource/paludis_package.rb +5 -7
- data/lib/chef/resource/perl.rb +5 -5
- data/lib/chef/resource/portage_package.rb +5 -4
- data/lib/chef/resource/powershell_script.rb +7 -7
- data/lib/chef/resource/python.rb +5 -5
- data/lib/chef/resource/reboot.rb +6 -6
- data/lib/chef/resource/registry_key.rb +15 -15
- data/lib/chef/resource/remote_directory.rb +23 -24
- data/lib/chef/resource/remote_file.rb +21 -21
- data/lib/chef/resource/resource_notification.rb +2 -2
- data/lib/chef/resource/route.rb +26 -26
- data/lib/chef/resource/rpm_package.rb +5 -15
- data/lib/chef/resource/ruby.rb +5 -5
- data/lib/chef/resource/ruby_block.rb +8 -8
- data/lib/chef/resource/scm.rb +36 -37
- data/lib/chef/resource/script.rb +13 -13
- data/lib/chef/resource/service.rb +32 -32
- data/lib/chef/resource/smartos_package.rb +4 -3
- data/lib/chef/resource/solaris_package.rb +4 -3
- data/lib/chef/resource/subversion.rb +6 -6
- data/lib/chef/resource/template.rb +19 -19
- data/lib/chef/resource/timestamped_deploy.rb +1 -1
- data/lib/chef/resource/user.rb +31 -31
- data/lib/chef/resource/whyrun_safe_ruby_block.rb +1 -1
- data/lib/chef/resource/windows_package.rb +21 -66
- data/lib/chef/resource/windows_script.rb +8 -8
- data/lib/chef/resource/windows_service.rb +9 -9
- data/lib/chef/resource/yum_package.rb +18 -42
- data/lib/chef/resource/zypper_package.rb +3 -2
- data/lib/chef/resource_builder.rb +4 -4
- data/lib/chef/resource_collection.rb +11 -11
- data/lib/chef/resource_collection/resource_collection_serialization.rb +5 -5
- data/lib/chef/resource_collection/resource_list.rb +6 -6
- data/lib/chef/resource_collection/resource_set.rb +6 -6
- data/lib/chef/resource_collection/stepable_iterator.rb +4 -4
- data/lib/chef/resource_definition.rb +7 -7
- data/lib/chef/resource_definition_list.rb +5 -5
- data/lib/chef/resource_reporter.rb +14 -15
- data/lib/chef/resource_resolver.rb +4 -5
- data/lib/chef/resources.rb +71 -68
- data/lib/chef/rest.rb +23 -23
- data/lib/chef/role.rb +49 -43
- data/lib/chef/run_context.rb +21 -23
- data/lib/chef/run_context/cookbook_compiler.rb +10 -13
- data/lib/chef/run_list.rb +17 -17
- data/lib/chef/run_list/run_list_expansion.rb +22 -26
- data/lib/chef/run_list/run_list_item.rb +8 -9
- data/lib/chef/run_list/versioned_recipe_list.rb +13 -13
- data/lib/chef/run_lock.rb +12 -12
- data/lib/chef/run_status.rb +3 -3
- data/lib/chef/runner.rb +11 -12
- data/lib/chef/scan_access_control.rb +7 -7
- data/lib/chef/search/query.rb +30 -16
- data/lib/chef/server_api.rb +42 -10
- data/lib/chef/shell.rb +24 -25
- data/lib/chef/shell/ext.rb +31 -31
- data/lib/chef/shell/model_wrapper.rb +7 -8
- data/lib/chef/shell/shell_session.rb +20 -19
- data/lib/chef/shell_out.rb +2 -2
- data/lib/chef/tasks/chef_repo.rake +62 -63
- data/lib/chef/user.rb +38 -37
- data/lib/chef/user_v1.rb +53 -58
- data/lib/chef/util/backup.rb +6 -6
- data/lib/chef/util/diff.rb +8 -8
- data/lib/chef/util/dsc/configuration_generator.rb +11 -11
- data/lib/chef/util/dsc/lcm_output_parser.rb +8 -8
- data/lib/chef/util/dsc/local_configuration_manager.rb +9 -9
- data/lib/chef/util/dsc/resource_info.rb +15 -15
- data/lib/chef/util/dsc/resource_store.rb +73 -74
- data/lib/chef/util/editor.rb +1 -2
- data/lib/chef/util/file_edit.rb +5 -5
- data/lib/chef/util/path_helper.rb +2 -2
- data/lib/chef/util/powershell/cmdlet.rb +119 -119
- data/lib/chef/util/powershell/cmdlet_result.rb +36 -36
- data/lib/chef/util/powershell/ps_credential.rb +2 -2
- data/lib/chef/util/selinux.rb +6 -6
- data/lib/chef/util/threaded_job_queue.rb +2 -2
- data/lib/chef/util/windows.rb +1 -1
- data/lib/chef/util/windows/net_group.rb +84 -85
- data/lib/chef/util/windows/net_use.rb +6 -6
- data/lib/chef/util/windows/net_user.rb +9 -8
- data/lib/chef/util/windows/volume.rb +3 -3
- data/lib/chef/version.rb +2 -2
- data/lib/chef/version/platform.rb +5 -5
- data/lib/chef/version_class.rb +6 -6
- data/lib/chef/version_constraint.rb +13 -13
- data/lib/chef/version_constraint/platform.rb +3 -3
- data/lib/chef/whitelist.rb +2 -2
- data/lib/chef/win32/api.rb +13 -8
- data/lib/chef/win32/api/crypto.rb +63 -63
- data/lib/chef/win32/api/error.rb +11 -10
- data/lib/chef/win32/api/file.rb +17 -16
- data/lib/chef/win32/api/installer.rb +15 -16
- data/lib/chef/win32/api/memory.rb +4 -4
- data/lib/chef/win32/api/net.rb +111 -123
- data/lib/chef/win32/api/process.rb +4 -4
- data/lib/chef/win32/api/psapi.rb +4 -4
- data/lib/chef/win32/api/registry.rb +4 -4
- data/lib/chef/win32/api/security.rb +51 -26
- data/lib/chef/win32/api/synchronization.rb +4 -4
- data/lib/chef/win32/api/system.rb +4 -4
- data/lib/chef/win32/api/unicode.rb +4 -4
- data/lib/chef/win32/crypto.rb +50 -50
- data/lib/chef/win32/error.rb +18 -15
- data/lib/chef/win32/eventlog.rb +2 -2
- data/lib/chef/win32/file.rb +14 -14
- data/lib/chef/win32/file/info.rb +3 -4
- data/lib/chef/win32/file/version_info.rb +4 -4
- data/lib/chef/win32/handle.rb +6 -6
- data/lib/chef/win32/memory.rb +4 -4
- data/lib/chef/win32/mutex.rb +4 -4
- data/lib/chef/win32/net.rb +26 -59
- data/lib/chef/win32/process.rb +7 -7
- data/lib/chef/win32/registry.rb +19 -33
- data/lib/chef/win32/security.rb +82 -20
- data/lib/chef/win32/security/ace.rb +6 -6
- data/lib/chef/win32/security/acl.rb +8 -8
- data/lib/chef/win32/security/securable_object.rb +5 -5
- data/lib/chef/win32/security/security_descriptor.rb +5 -5
- data/lib/chef/win32/security/sid.rb +81 -43
- data/lib/chef/win32/security/token.rb +6 -6
- data/lib/chef/win32/system.rb +4 -4
- data/lib/chef/win32/unicode.rb +7 -7
- data/lib/chef/win32/version.rb +26 -26
- data/lib/chef/workstation_config_loader.rb +2 -2
- data/spec/data/apt/chef-integration-test-1.0/debian/copyright +2 -2
- data/spec/data/apt/chef-integration-test-1.1/debian/copyright +2 -2
- data/spec/data/apt/chef-integration-test2-1.0/debian/copyright +2 -2
- data/spec/data/cookbooks/name-mismatch-versionnumber/recipes/default.rb +1 -1
- data/spec/data/cookbooks/supports-platform-constraints/metadata.rb +5 -0
- data/spec/data/incomplete-metadata-chef-repo/incomplete-metadata/recipes/default.rb +1 -1
- data/spec/data/invalid-metadata-chef-repo/invalid-metadata/metadata.rb +1 -2
- data/spec/data/invalid-metadata-chef-repo/invalid-metadata/recipes/default.rb +1 -1
- data/spec/functional/application_spec.rb +7 -7
- data/spec/functional/assets/chocolatey_feed/test-A.1.0.nupkg +0 -0
- data/spec/functional/assets/chocolatey_feed/test-A.1.5.nupkg +0 -0
- data/spec/functional/assets/chocolatey_feed/test-A.2.0.nupkg +0 -0
- data/spec/functional/assets/chocolatey_feed/test-B.1.0.nupkg +0 -0
- data/spec/functional/audit/rspec_formatter_spec.rb +8 -8
- data/spec/functional/audit/runner_spec.rb +9 -9
- data/spec/functional/dsl/reboot_pending_spec.rb +10 -15
- data/spec/functional/dsl/registry_helper_spec.rb +8 -10
- data/spec/functional/event_loggers/windows_eventlog_spec.rb +27 -22
- data/spec/functional/file_content_management/deploy_strategies_spec.rb +9 -10
- data/spec/functional/http/simple_spec.rb +11 -11
- data/spec/functional/knife/configure_spec.rb +5 -10
- data/spec/functional/knife/cookbook_delete_spec.rb +11 -11
- data/spec/functional/knife/exec_spec.rb +6 -6
- data/spec/functional/knife/smoke_test.rb +11 -3
- data/spec/functional/knife/ssh_spec.rb +22 -22
- data/spec/functional/mixin/powershell_out_spec.rb +3 -3
- data/spec/functional/mixin/shell_out_spec.rb +12 -12
- data/spec/functional/notifications_spec.rb +6 -7
- data/spec/functional/provider/remote_file/cache_control_data_spec.rb +11 -12
- data/spec/functional/provider/whyrun_safe_ruby_block_spec.rb +4 -4
- data/spec/functional/rebooter_spec.rb +12 -12
- data/spec/functional/resource/aix_service_spec.rb +7 -8
- data/spec/functional/resource/aixinit_service_spec.rb +20 -20
- data/spec/functional/resource/base.rb +1 -3
- data/spec/functional/resource/bash_spec.rb +6 -6
- data/spec/functional/resource/batch_spec.rb +5 -5
- data/spec/functional/resource/bff_spec.rb +10 -12
- data/spec/functional/resource/chocolatey_package_spec.rb +124 -0
- data/spec/functional/resource/cookbook_file_spec.rb +9 -9
- data/spec/functional/resource/cron_spec.rb +13 -13
- data/spec/functional/resource/deploy_revision_spec.rb +18 -18
- data/spec/functional/resource/directory_spec.rb +4 -4
- data/spec/functional/resource/dpkg_package_spec.rb +38 -38
- data/spec/functional/resource/dsc_resource_spec.rb +17 -22
- data/spec/functional/resource/dsc_script_spec.rb +104 -106
- data/spec/functional/resource/env_spec.rb +30 -30
- data/spec/functional/resource/execute_spec.rb +10 -10
- data/spec/functional/resource/file_spec.rb +12 -13
- data/spec/functional/resource/git_spec.rb +20 -20
- data/spec/functional/resource/group_spec.rb +21 -21
- data/spec/functional/resource/ifconfig_spec.rb +11 -11
- data/spec/functional/resource/link_spec.rb +140 -135
- data/spec/functional/resource/mount_spec.rb +17 -29
- data/spec/functional/resource/ohai_spec.rb +5 -8
- data/spec/functional/resource/package_spec.rb +11 -13
- data/spec/functional/resource/powershell_script_spec.rb +60 -60
- data/spec/functional/resource/reboot_spec.rb +12 -12
- data/spec/functional/resource/registry_spec.rb +71 -72
- data/spec/functional/resource/remote_directory_spec.rb +23 -23
- data/spec/functional/resource/remote_file_spec.rb +17 -17
- data/spec/functional/resource/rpm_spec.rb +14 -14
- data/spec/functional/resource/template_spec.rb +8 -8
- data/spec/functional/resource/user/dscl_spec.rb +3 -3
- data/spec/functional/resource/user/useradd_spec.rb +31 -37
- data/spec/functional/resource/user/windows_spec.rb +20 -20
- data/spec/functional/resource/windows_package_spec.rb +26 -35
- data/spec/functional/resource/windows_service_spec.rb +12 -8
- data/spec/functional/rest_spec.rb +6 -5
- data/spec/functional/run_lock_spec.rb +15 -14
- data/spec/functional/shell_spec.rb +11 -10
- data/spec/functional/tiny_server_spec.rb +18 -18
- data/spec/functional/util/path_helper_spec.rb +5 -5
- data/spec/functional/util/powershell/cmdlet_spec.rb +24 -27
- data/spec/functional/version_spec.rb +6 -6
- data/spec/functional/win32/crypto_spec.rb +7 -10
- data/spec/functional/win32/registry_spec.rb +105 -107
- data/spec/functional/win32/security_spec.rb +17 -17
- data/spec/functional/win32/service_manager_spec.rb +7 -8
- data/spec/functional/win32/sid_spec.rb +13 -13
- data/spec/functional/win32/version_info_spec.rb +7 -7
- data/spec/functional/win32/versions_spec.rb +13 -13
- data/spec/integration/client/client_spec.rb +65 -66
- data/spec/integration/client/ipv6_spec.rb +15 -16
- data/spec/integration/knife/chef_fs_data_store_spec.rb +432 -246
- data/spec/integration/knife/chef_repo_path_spec.rb +261 -261
- data/spec/integration/knife/chef_repository_file_system_spec.rb +84 -84
- data/spec/integration/knife/chefignore_spec.rb +82 -82
- data/spec/integration/knife/common_options_spec.rb +41 -41
- data/spec/integration/knife/cookbook_api_ipv6_spec.rb +9 -9
- data/spec/integration/knife/delete_spec.rb +262 -248
- data/spec/integration/knife/deps_spec.rb +301 -301
- data/spec/integration/knife/diff_spec.rb +237 -237
- data/spec/integration/knife/download_spec.rb +532 -401
- data/spec/integration/knife/list_spec.rb +310 -116
- data/spec/integration/knife/raw_spec.rb +39 -39
- data/spec/integration/knife/redirection_spec.rb +12 -12
- data/spec/integration/knife/serve_spec.rb +12 -12
- data/spec/integration/knife/show_spec.rb +59 -59
- data/spec/integration/knife/upload_spec.rb +661 -550
- data/spec/integration/recipes/lwrp_inline_resources_spec.rb +18 -18
- data/spec/integration/recipes/lwrp_spec.rb +7 -7
- data/spec/integration/recipes/provider_choice.rb +3 -2
- data/spec/integration/recipes/recipe_dsl_spec.rb +151 -124
- data/spec/integration/recipes/remote_directory.rb +2 -2
- data/spec/integration/recipes/resource_action_spec.rb +439 -328
- data/spec/integration/recipes/resource_converge_if_changed_spec.rb +12 -11
- data/spec/integration/recipes/resource_load_spec.rb +35 -33
- data/spec/integration/solo/solo_spec.rb +31 -32
- data/spec/scripts/ssl-serve.rb +12 -17
- data/spec/spec_helper.rb +48 -43
- data/spec/stress/win32/file_spec.rb +5 -5
- data/spec/stress/win32/memory_spec.rb +4 -4
- data/spec/stress/win32/security_spec.rb +8 -8
- data/spec/support/chef_helpers.rb +5 -6
- data/spec/support/key_helpers.rb +2 -2
- data/spec/support/lib/chef/provider/easy.rb +2 -2
- data/spec/support/lib/chef/provider/openldap_includer.rb +2 -2
- data/spec/support/lib/chef/provider/snakeoil.rb +2 -2
- data/spec/support/lib/chef/resource/cat.rb +4 -4
- data/spec/support/lib/chef/resource/one_two_three_four.rb +2 -2
- data/spec/support/lib/chef/resource/openldap_includer.rb +2 -3
- data/spec/support/lib/chef/resource/with_state.rb +4 -4
- data/spec/support/lib/chef/resource/zen_follower.rb +4 -4
- data/spec/support/lib/chef/resource/zen_master.rb +5 -6
- data/spec/support/lib/library_load_order.rb +0 -2
- data/spec/support/matchers/leak.rb +7 -5
- data/spec/support/mock/constant.rb +3 -3
- data/spec/support/mock/platform.rb +5 -5
- data/spec/support/platform_helpers.rb +36 -23
- data/spec/support/platforms/prof/gc.rb +2 -3
- data/spec/support/platforms/prof/win32.rb +3 -4
- data/spec/support/platforms/win32/spec_service.rb +3 -3
- data/spec/support/shared/context/client.rb +22 -14
- data/spec/support/shared/context/config.rb +3 -3
- data/spec/support/shared/context/win32.rb +9 -9
- data/spec/support/shared/examples/client.rb +4 -4
- data/spec/support/shared/functional/diff_disabled.rb +1 -1
- data/spec/support/shared/functional/directory_resource.rb +8 -8
- data/spec/support/shared/functional/file_resource.rb +20 -23
- data/spec/support/shared/functional/http.rb +33 -34
- data/spec/support/shared/functional/knife.rb +3 -3
- data/spec/support/shared/functional/securable_resource.rb +48 -48
- data/spec/support/shared/functional/securable_resource_with_reporting.rb +8 -12
- data/spec/support/shared/functional/win32_service.rb +3 -5
- data/spec/support/shared/functional/windows_script.rb +13 -13
- data/spec/support/shared/integration/app_server_support.rb +7 -7
- data/spec/support/shared/integration/integration_helper.rb +21 -21
- data/spec/support/shared/integration/knife_support.rb +13 -13
- data/spec/support/shared/matchers/exit_with_code.rb +2 -2
- data/spec/support/shared/matchers/match_environment_variable.rb +2 -2
- data/spec/support/shared/unit/api_error_inspector.rb +3 -5
- data/spec/support/shared/unit/api_versioning.rb +8 -8
- data/spec/support/shared/unit/execute_resource.rb +4 -4
- data/spec/support/shared/unit/file_system_support.rb +12 -13
- data/spec/support/shared/unit/knife_shared.rb +1 -2
- data/spec/support/shared/unit/mock_shellout.rb +5 -2
- data/spec/support/shared/unit/platform_introspector.rb +35 -37
- data/spec/support/shared/unit/provider/file.rb +29 -40
- data/spec/support/shared/unit/provider/useradd_based_user_provider.rb +50 -51
- data/spec/support/shared/unit/resource/static_provider_resolution.rb +2 -5
- data/spec/support/shared/unit/script_resource.rb +10 -10
- data/spec/support/shared/unit/user_and_client_shared.rb +5 -6
- data/spec/support/shared/unit/windows_script_resource.rb +6 -7
- data/spec/tiny_server.rb +24 -24
- data/spec/unit/api_client/registration_spec.rb +41 -38
- data/spec/unit/api_client_spec.rb +13 -16
- data/spec/unit/api_client_v1_spec.rb +17 -19
- data/spec/unit/application/apply_spec.rb +3 -3
- data/spec/unit/application/client_spec.rb +12 -9
- data/spec/unit/application/knife_spec.rb +69 -17
- data/spec/unit/application/solo_spec.rb +29 -48
- data/spec/unit/application_spec.rb +171 -151
- data/spec/unit/audit/audit_event_proxy_spec.rb +13 -13
- data/spec/unit/audit/audit_reporter_spec.rb +18 -25
- data/spec/unit/audit/control_group_data_spec.rb +16 -17
- data/spec/unit/audit/logger_spec.rb +5 -5
- data/spec/unit/audit/rspec_formatter_spec.rb +4 -4
- data/spec/unit/audit/runner_spec.rb +11 -12
- data/spec/unit/chef_class_spec.rb +5 -5
- data/spec/unit/chef_fs/config_spec.rb +14 -18
- data/spec/unit/chef_fs/data_handler/group_handler_spec.rb +17 -17
- data/spec/unit/chef_fs/diff_spec.rb +75 -75
- data/spec/unit/chef_fs/file_pattern_spec.rb +368 -369
- data/spec/unit/chef_fs/file_system/cookbook_subdir_spec.rb +9 -9
- data/spec/unit/chef_fs/file_system/operation_failed_error_spec.rb +9 -9
- data/spec/unit/chef_fs/file_system_spec.rb +74 -74
- data/spec/unit/chef_fs/parallelizer.rb +63 -66
- data/spec/unit/chef_fs/path_util_spec.rb +45 -45
- data/spec/unit/chef_spec.rb +3 -3
- data/spec/unit/client_spec.rb +44 -44
- data/spec/unit/config_fetcher_spec.rb +56 -28
- data/spec/unit/config_spec.rb +2 -2
- data/spec/unit/cookbook/chefignore_spec.rb +12 -12
- data/spec/unit/cookbook/cookbook_version_loader_spec.rb +5 -6
- data/spec/unit/cookbook/file_vendor_spec.rb +8 -9
- data/spec/unit/cookbook/metadata_spec.rb +73 -76
- data/spec/unit/cookbook/synchronizer_spec.rb +31 -32
- data/spec/unit/cookbook/syntax_check_spec.rb +22 -22
- data/spec/unit/cookbook_loader_spec.rb +9 -10
- data/spec/unit/cookbook_manifest_spec.rb +27 -28
- data/spec/unit/cookbook_site_streaming_uploader_spec.rb +24 -24
- data/spec/unit/cookbook_spec.rb +3 -3
- data/spec/unit/cookbook_uploader_spec.rb +10 -11
- data/spec/unit/cookbook_version_file_specificity_spec.rb +49 -50
- data/spec/unit/cookbook_version_spec.rb +45 -48
- data/spec/unit/daemon_spec.rb +5 -5
- data/spec/unit/data_bag_item_spec.rb +29 -30
- data/spec/unit/data_bag_spec.rb +47 -47
- data/spec/unit/deprecation_spec.rb +11 -11
- data/spec/unit/digester_spec.rb +5 -6
- data/spec/unit/dsl/audit_spec.rb +5 -5
- data/spec/unit/dsl/data_query_spec.rb +12 -12
- data/spec/unit/dsl/platform_introspection_spec.rb +19 -20
- data/spec/unit/dsl/reboot_pending_spec.rb +17 -17
- data/spec/unit/dsl/recipe_spec.rb +4 -6
- data/spec/unit/dsl/regsitry_helper_spec.rb +9 -12
- data/spec/unit/dsl/resources_spec.rb +13 -13
- data/spec/unit/encrypted_data_bag_item/check_encrypted_spec.rb +7 -7
- data/spec/unit/encrypted_data_bag_item_spec.rb +11 -11
- data/spec/unit/environment_spec.rb +53 -53
- data/spec/unit/event_dispatch/dispatcher_spec.rb +3 -4
- data/spec/unit/event_dispatch/dsl_spec.rb +16 -16
- data/spec/unit/exceptions_spec.rb +10 -10
- data/spec/unit/file_access_control_spec.rb +32 -32
- data/spec/unit/file_cache_spec.rb +19 -19
- data/spec/unit/file_content_management/deploy/cp_spec.rb +3 -5
- data/spec/unit/file_content_management/deploy/mv_unix_spec.rb +3 -5
- data/spec/unit/file_content_management/deploy/mv_windows_spec.rb +5 -12
- data/spec/unit/formatters/base_spec.rb +29 -6
- data/spec/unit/formatters/doc_spec.rb +7 -7
- data/spec/unit/formatters/error_inspectors/api_error_formatting_spec.rb +9 -10
- data/spec/unit/formatters/error_inspectors/compile_error_inspector_spec.rb +11 -11
- data/spec/unit/formatters/error_inspectors/cookbook_resolve_error_inspector_spec.rb +4 -7
- data/spec/unit/formatters/error_inspectors/cookbook_sync_error_inspector_spec.rb +3 -3
- data/spec/unit/formatters/error_inspectors/node_load_error_inspector_spec.rb +3 -4
- data/spec/unit/formatters/error_inspectors/registration_error_inspector_spec.rb +3 -4
- data/spec/unit/formatters/error_inspectors/resource_failure_inspector_spec.rb +4 -6
- data/spec/unit/formatters/error_inspectors/run_list_expansion_error_inspector_spec.rb +5 -7
- data/spec/unit/guard_interpreter/resource_guard_interpreter_spec.rb +9 -9
- data/spec/unit/guard_interpreter_spec.rb +3 -3
- data/spec/unit/handler/json_file_spec.rb +11 -12
- data/spec/unit/handler_spec.rb +7 -7
- data/spec/unit/http/authenticator_spec.rb +9 -7
- data/spec/unit/http/basic_client_spec.rb +3 -3
- data/spec/unit/http/http_request_spec.rb +22 -22
- data/spec/unit/http/json_input_spec.rb +7 -7
- data/spec/unit/http/simple_spec.rb +3 -3
- data/spec/unit/http/socketless_chef_zero_client_spec.rb +3 -4
- data/spec/unit/http/ssl_policies_spec.rb +18 -19
- data/spec/unit/http/validate_content_length_spec.rb +9 -9
- data/spec/unit/http_spec.rb +18 -18
- data/spec/unit/json_compat_spec.rb +16 -9
- data/spec/unit/key_spec.rb +41 -44
- data/spec/unit/knife/bootstrap/chef_vault_handler_spec.rb +41 -42
- data/spec/unit/knife/bootstrap/client_builder_spec.rb +30 -28
- data/spec/unit/knife/bootstrap_spec.rb +75 -37
- data/spec/unit/knife/client_bulk_delete_spec.rb +6 -6
- data/spec/unit/knife/client_create_spec.rb +11 -12
- data/spec/unit/knife/client_delete_spec.rb +13 -13
- data/spec/unit/knife/client_edit_spec.rb +9 -9
- data/spec/unit/knife/client_list_spec.rb +5 -5
- data/spec/unit/knife/client_reregister_spec.rb +13 -13
- data/spec/unit/knife/client_show_spec.rb +12 -12
- data/spec/unit/knife/configure_client_spec.rb +19 -20
- data/spec/unit/knife/configure_spec.rb +37 -39
- data/spec/unit/knife/cookbook_bulk_delete_spec.rb +17 -19
- data/spec/unit/knife/cookbook_create_spec.rb +32 -32
- data/spec/unit/knife/cookbook_delete_spec.rb +79 -79
- data/spec/unit/knife/cookbook_download_spec.rb +84 -85
- data/spec/unit/knife/cookbook_list_spec.rb +26 -26
- data/spec/unit/knife/cookbook_metadata_from_file_spec.rb +5 -5
- data/spec/unit/knife/cookbook_metadata_spec.rb +55 -55
- data/spec/unit/knife/cookbook_show_spec.rb +33 -34
- data/spec/unit/knife/cookbook_site_download_spec.rb +51 -53
- data/spec/unit/knife/cookbook_site_install_spec.rb +10 -8
- data/spec/unit/knife/cookbook_site_share_spec.rb +42 -42
- data/spec/unit/knife/cookbook_site_unshare_spec.rb +20 -20
- data/spec/unit/knife/cookbook_test_spec.rb +6 -6
- data/spec/unit/knife/cookbook_upload_spec.rb +69 -69
- data/spec/unit/knife/core/bootstrap_context_spec.rb +39 -33
- data/spec/unit/knife/core/cookbook_scm_repo_spec.rb +32 -32
- data/spec/unit/knife/core/custom_manifest_loader_spec.rb +3 -3
- data/spec/unit/knife/core/gem_glob_loader_spec.rb +23 -24
- data/spec/unit/knife/core/hashed_command_loader_spec.rb +8 -8
- data/spec/unit/knife/core/node_editor_spec.rb +211 -0
- data/spec/unit/knife/core/object_loader_spec.rb +12 -12
- data/spec/unit/knife/core/subcommand_loader_spec.rb +10 -10
- data/spec/unit/knife/core/ui_spec.rb +45 -45
- data/spec/unit/knife/data_bag_create_spec.rb +14 -14
- data/spec/unit/knife/data_bag_edit_spec.rb +12 -12
- data/spec/unit/knife/data_bag_from_file_spec.rb +9 -9
- data/spec/unit/knife/data_bag_secret_options_spec.rb +6 -6
- data/spec/unit/knife/data_bag_show_spec.rb +19 -19
- data/spec/unit/knife/environment_compare_spec.rb +32 -32
- data/spec/unit/knife/environment_create_spec.rb +2 -2
- data/spec/unit/knife/environment_delete_spec.rb +2 -2
- data/spec/unit/knife/environment_edit_spec.rb +2 -2
- data/spec/unit/knife/environment_from_file_spec.rb +5 -5
- data/spec/unit/knife/environment_list_spec.rb +4 -4
- data/spec/unit/knife/environment_show_spec.rb +2 -2
- data/spec/unit/knife/index_rebuild_spec.rb +14 -17
- data/spec/unit/knife/key_create_spec.rb +11 -12
- data/spec/unit/knife/key_delete_spec.rb +8 -10
- data/spec/unit/knife/key_edit_spec.rb +14 -17
- data/spec/unit/knife/key_helper.rb +2 -2
- data/spec/unit/knife/key_list_spec.rb +13 -13
- data/spec/unit/knife/key_show_spec.rb +11 -11
- data/spec/unit/knife/knife_help.rb +2 -2
- data/spec/unit/knife/node_bulk_delete_spec.rb +10 -13
- data/spec/unit/knife/node_delete_spec.rb +4 -4
- data/spec/unit/knife/node_edit_spec.rb +17 -18
- data/spec/unit/knife/node_environment_set_spec.rb +4 -4
- data/spec/unit/knife/node_from_file_spec.rb +5 -5
- data/spec/unit/knife/node_list_spec.rb +5 -6
- data/spec/unit/knife/node_run_list_add_spec.rb +5 -8
- data/spec/unit/knife/node_run_list_remove_spec.rb +27 -27
- data/spec/unit/knife/node_run_list_set_spec.rb +4 -4
- data/spec/unit/knife/node_show_spec.rb +6 -6
- data/spec/unit/knife/osc_user_create_spec.rb +7 -7
- data/spec/unit/knife/osc_user_delete_spec.rb +7 -7
- data/spec/unit/knife/osc_user_edit_spec.rb +6 -6
- data/spec/unit/knife/osc_user_list_spec.rb +3 -3
- data/spec/unit/knife/osc_user_reregister_spec.rb +10 -10
- data/spec/unit/knife/osc_user_show_spec.rb +8 -8
- data/spec/unit/knife/raw_spec.rb +6 -6
- data/spec/unit/knife/role_bulk_delete_spec.rb +4 -4
- data/spec/unit/knife/role_create_spec.rb +4 -4
- data/spec/unit/knife/role_delete_spec.rb +4 -4
- data/spec/unit/knife/role_edit_spec.rb +4 -6
- data/spec/unit/knife/role_env_run_list_add_spec.rb +9 -9
- data/spec/unit/knife/role_env_run_list_clear_spec.rb +38 -44
- data/spec/unit/knife/role_env_run_list_remove_spec.rb +46 -52
- data/spec/unit/knife/role_env_run_list_replace_spec.rb +49 -52
- data/spec/unit/knife/role_env_run_list_set_spec.rb +17 -20
- data/spec/unit/knife/role_from_file_spec.rb +7 -7
- data/spec/unit/knife/role_list_spec.rb +5 -7
- data/spec/unit/knife/role_run_list_add_spec.rb +7 -7
- data/spec/unit/knife/role_run_list_clear_spec.rb +28 -34
- data/spec/unit/knife/role_run_list_remove_spec.rb +36 -42
- data/spec/unit/knife/role_run_list_replace_spec.rb +42 -45
- data/spec/unit/knife/role_run_list_set_spec.rb +6 -9
- data/spec/unit/knife/role_show_spec.rb +14 -14
- data/spec/unit/knife/ssh_spec.rb +36 -36
- data/spec/unit/knife/ssl_check_spec.rb +7 -7
- data/spec/unit/knife/ssl_fetch_spec.rb +8 -8
- data/spec/unit/knife/status_spec.rb +5 -5
- data/spec/unit/knife/tag_create_spec.rb +1 -1
- data/spec/unit/knife/tag_delete_spec.rb +1 -1
- data/spec/unit/knife/tag_list_spec.rb +2 -2
- data/spec/unit/knife/user_create_spec.rb +30 -30
- data/spec/unit/knife/user_delete_spec.rb +11 -11
- data/spec/unit/knife/user_edit_spec.rb +9 -9
- data/spec/unit/knife/user_list_spec.rb +3 -3
- data/spec/unit/knife/user_reregister_spec.rb +13 -13
- data/spec/unit/knife/user_show_spec.rb +12 -12
- data/spec/unit/knife_spec.rb +61 -61
- data/spec/unit/lib_backcompat_spec.rb +34 -0
- data/spec/unit/log/syslog_spec.rb +3 -3
- data/spec/unit/log/winevt_spec.rb +3 -3
- data/spec/unit/log_spec.rb +5 -5
- data/spec/unit/lwrp_spec.rb +41 -43
- data/spec/unit/mash_spec.rb +8 -8
- data/spec/unit/mixin/api_version_request_handling_spec.rb +13 -14
- data/spec/unit/mixin/checksum_spec.rb +5 -6
- data/spec/unit/mixin/command_spec.rb +9 -9
- data/spec/unit/mixin/convert_to_class_name_spec.rb +2 -2
- data/spec/unit/mixin/deep_merge_spec.rb +107 -107
- data/spec/unit/mixin/deprecation_spec.rb +5 -5
- data/spec/unit/mixin/enforce_ownership_and_permissions_spec.rb +9 -9
- data/spec/unit/mixin/homebrew_user_spec.rb +13 -13
- data/spec/unit/mixin/params_validate_spec.rb +71 -71
- data/spec/unit/mixin/path_sanity_spec.rb +16 -16
- data/spec/unit/mixin/powershell_out_spec.rb +9 -9
- data/spec/unit/mixin/powershell_type_coercions_spec.rb +34 -23
- data/spec/unit/mixin/properties_spec.rb +27 -27
- data/spec/unit/mixin/proxified_socket_spec.rb +6 -6
- data/spec/unit/mixin/securable_spec.rb +37 -37
- data/spec/unit/mixin/shell_out_spec.rb +68 -68
- data/spec/unit/mixin/subclass_directive_spec.rb +2 -2
- data/spec/unit/mixin/template_spec.rb +15 -12
- data/spec/unit/mixin/unformatter_spec.rb +3 -3
- data/spec/unit/mixin/uris_spec.rb +8 -8
- data/spec/unit/mixin/windows_architecture_helper_spec.rb +14 -17
- data/spec/unit/mixin/xml_escape_spec.rb +3 -3
- data/spec/unit/monkey_patches/uri_spec.rb +3 -3
- data/spec/unit/monologger_spec.rb +4 -4
- data/spec/unit/node/attribute_spec.rb +203 -248
- data/spec/unit/node/immutable_collections_spec.rb +20 -21
- data/spec/unit/node_map_spec.rb +5 -5
- data/spec/unit/node_spec.rb +165 -135
- data/spec/unit/org_spec.rb +17 -17
- data/spec/unit/platform/query_helpers_spec.rb +23 -23
- data/spec/unit/platform_spec.rb +17 -17
- data/spec/unit/policy_builder/dynamic_spec.rb +8 -10
- data/spec/unit/policy_builder/expand_node_object_spec.rb +16 -14
- data/spec/unit/policy_builder/policyfile_spec.rb +30 -37
- data/spec/unit/policy_builder_spec.rb +4 -4
- data/spec/unit/property/state_spec.rb +58 -56
- data/spec/unit/property/validation_spec.rb +255 -216
- data/spec/unit/property_spec.rb +206 -129
- data/spec/unit/provider/apt_update_spec.rb +113 -0
- data/spec/unit/provider/breakpoint_spec.rb +2 -3
- data/spec/unit/provider/cookbook_file/content_spec.rb +9 -10
- data/spec/unit/provider/cookbook_file_spec.rb +11 -11
- data/spec/unit/provider/cron/unix_spec.rb +7 -7
- data/spec/unit/provider/cron_spec.rb +67 -67
- data/spec/unit/provider/deploy/revision_spec.rb +6 -7
- data/spec/unit/provider/deploy/timestamped_spec.rb +2 -2
- data/spec/unit/provider/deploy_spec.rb +24 -25
- data/spec/unit/provider/directory_spec.rb +12 -12
- data/spec/unit/provider/dsc_resource_spec.rb +29 -27
- data/spec/unit/provider/dsc_script_spec.rb +47 -48
- data/spec/unit/provider/env/windows_spec.rb +21 -21
- data/spec/unit/provider/env_spec.rb +5 -5
- data/spec/unit/provider/erl_call_spec.rb +3 -4
- data/spec/unit/provider/execute_spec.rb +5 -5
- data/spec/unit/provider/file/content_spec.rb +4 -4
- data/spec/unit/provider/file_spec.rb +8 -9
- data/spec/unit/provider/git_spec.rb +64 -65
- data/spec/unit/provider/group/dscl_spec.rb +7 -7
- data/spec/unit/provider/group/gpasswd_spec.rb +3 -3
- data/spec/unit/provider/group/groupadd_spec.rb +9 -9
- data/spec/unit/provider/group/groupmod_spec.rb +12 -12
- data/spec/unit/provider/group/pw_spec.rb +3 -3
- data/spec/unit/provider/group/usermod_spec.rb +6 -6
- data/spec/unit/provider/group/windows_spec.rb +3 -3
- data/spec/unit/provider/group_spec.rb +16 -16
- data/spec/unit/provider/http_request_spec.rb +7 -7
- data/spec/unit/provider/ifconfig/aix_spec.rb +4 -5
- data/spec/unit/provider/ifconfig/debian_spec.rb +6 -6
- data/spec/unit/provider/ifconfig/redhat_spec.rb +3 -3
- data/spec/unit/provider/ifconfig_spec.rb +5 -5
- data/spec/unit/provider/link_spec.rb +12 -12
- data/spec/unit/provider/log_spec.rb +2 -2
- data/spec/unit/provider/mdadm_spec.rb +12 -12
- data/spec/unit/provider/mount/aix_spec.rb +7 -7
- data/spec/unit/provider/mount/mount_spec.rb +20 -20
- data/spec/unit/provider/mount/solaris_spec.rb +26 -26
- data/spec/unit/provider/mount/windows_spec.rb +8 -8
- data/spec/unit/provider/mount_spec.rb +7 -8
- data/spec/unit/provider/ohai_spec.rb +13 -13
- data/spec/unit/provider/osx_profile_spec.rb +249 -0
- data/spec/unit/provider/package/aix_spec.rb +5 -5
- data/spec/unit/provider/package/apt_spec.rb +49 -49
- data/spec/unit/provider/package/chocolatey_spec.rb +504 -0
- data/spec/unit/provider/package/dpkg_spec.rb +32 -36
- data/spec/unit/provider/package/easy_install_spec.rb +11 -15
- data/spec/unit/provider/package/freebsd/pkg_spec.rb +10 -10
- data/spec/unit/provider/package/freebsd/pkgng_spec.rb +12 -19
- data/spec/unit/provider/package/freebsd/port_spec.rb +12 -19
- data/spec/unit/provider/package/homebrew_spec.rb +139 -139
- data/spec/unit/provider/package/ips_spec.rb +10 -11
- data/spec/unit/provider/package/macports_spec.rb +3 -3
- data/spec/unit/provider/package/openbsd_spec.rb +38 -38
- data/spec/unit/provider/package/pacman_spec.rb +8 -9
- data/spec/unit/provider/package/paludis_spec.rb +9 -10
- data/spec/unit/provider/package/portage_spec.rb +2 -2
- data/spec/unit/provider/package/rpm_spec.rb +7 -11
- data/spec/unit/provider/package/rubygems_spec.rb +386 -289
- data/spec/unit/provider/package/smartos_spec.rb +8 -10
- data/spec/unit/provider/package/solaris_spec.rb +4 -4
- data/spec/unit/provider/package/windows/exe_spec.rb +17 -81
- data/spec/unit/provider/package/windows/msi_spec.rb +16 -16
- data/spec/unit/provider/package/windows_spec.rb +50 -40
- data/spec/unit/provider/package/yum_spec.rb +179 -181
- data/spec/unit/provider/package/zypper_spec.rb +53 -50
- data/spec/unit/provider/package_spec.rb +104 -104
- data/spec/unit/provider/powershell_script_spec.rb +20 -20
- data/spec/unit/provider/registry_key_spec.rb +3 -3
- data/spec/unit/provider/remote_directory_spec.rb +46 -46
- data/spec/unit/provider/remote_file/cache_control_data_spec.rb +9 -10
- data/spec/unit/provider/remote_file/content_spec.rb +5 -6
- data/spec/unit/provider/remote_file/fetcher_spec.rb +3 -3
- data/spec/unit/provider/remote_file/ftp_spec.rb +3 -3
- data/spec/unit/provider/remote_file/http_spec.rb +10 -12
- data/spec/unit/provider/remote_file/local_file_spec.rb +2 -2
- data/spec/unit/provider/remote_file/network_file_spec.rb +2 -2
- data/spec/unit/provider/remote_file_spec.rb +9 -11
- data/spec/unit/provider/route_spec.rb +26 -27
- data/spec/unit/provider/ruby_block_spec.rb +4 -5
- data/spec/unit/provider/script_spec.rb +11 -11
- data/spec/unit/provider/service/aix_service_spec.rb +5 -6
- data/spec/unit/provider/service/aixinit_service_spec.rb +26 -23
- data/spec/unit/provider/service/arch_service_spec.rb +15 -15
- data/spec/unit/provider/service/debian_service_spec.rb +37 -37
- data/spec/unit/provider/service/freebsd_service_spec.rb +9 -9
- data/spec/unit/provider/service/gentoo_service_spec.rb +4 -4
- data/spec/unit/provider/service/init_service_spec.rb +9 -9
- data/spec/unit/provider/service/insserv_service_spec.rb +3 -3
- data/spec/unit/provider/service/invokercd_service_spec.rb +9 -9
- data/spec/unit/provider/service/macosx_spec.rb +26 -26
- data/spec/unit/provider/service/openbsd_service_spec.rb +26 -26
- data/spec/unit/provider/service/redhat_spec.rb +16 -16
- data/spec/unit/provider/service/simple_service_spec.rb +5 -5
- data/spec/unit/provider/service/solaris_smf_service_spec.rb +51 -51
- data/spec/unit/provider/service/systemd_service_spec.rb +4 -4
- data/spec/unit/provider/service/upstart_service_spec.rb +13 -13
- data/spec/unit/provider/service/windows_spec.rb +28 -37
- data/spec/unit/provider/service_spec.rb +2 -3
- data/spec/unit/provider/subversion_spec.rb +27 -28
- data/spec/unit/provider/template/content_spec.rb +21 -21
- data/spec/unit/provider/template_spec.rb +15 -16
- data/spec/unit/provider/user/dscl_spec.rb +36 -37
- data/spec/unit/provider/user/pw_spec.rb +12 -12
- data/spec/unit/provider/user/solaris_spec.rb +31 -31
- data/spec/unit/provider/user/useradd_spec.rb +10 -10
- data/spec/unit/provider/user/windows_spec.rb +9 -9
- data/spec/unit/provider/user_spec.rb +19 -20
- data/spec/unit/provider/whyrun_safe_ruby_block_spec.rb +3 -4
- data/spec/unit/provider_resolver_spec.rb +63 -62
- data/spec/unit/provider_spec.rb +7 -8
- data/spec/unit/pure_application_spec.rb +3 -3
- data/spec/unit/recipe_spec.rb +13 -16
- data/spec/unit/resource/apt_package_spec.rb +4 -4
- data/spec/unit/resource/apt_update_spec.rb +38 -0
- data/spec/unit/resource/bash_spec.rb +3 -3
- data/spec/unit/resource/batch_spec.rb +5 -5
- data/spec/unit/resource/breakpoint_spec.rb +3 -3
- data/spec/unit/resource/chef_gem_spec.rb +5 -9
- data/spec/unit/resource/chocolatey_package_spec.rb +67 -0
- data/spec/unit/resource/conditional_action_not_nothing_spec.rb +2 -2
- data/spec/unit/resource/conditional_spec.rb +12 -12
- data/spec/unit/resource/cookbook_file_spec.rb +23 -24
- data/spec/unit/resource/cron_spec.rb +4 -4
- data/spec/unit/resource/csh_spec.rb +3 -3
- data/spec/unit/resource/deploy_revision_spec.rb +3 -3
- data/spec/unit/resource/deploy_spec.rb +23 -24
- data/spec/unit/resource/directory_spec.rb +4 -4
- data/spec/unit/resource/dpkg_package_spec.rb +5 -5
- data/spec/unit/resource/dsc_resource_spec.rb +11 -11
- data/spec/unit/resource/dsc_script_spec.rb +15 -15
- data/spec/unit/resource/easy_install_package_spec.rb +3 -3
- data/spec/unit/resource/env_spec.rb +5 -5
- data/spec/unit/resource/erl_call_spec.rb +3 -3
- data/spec/unit/resource/execute_spec.rb +4 -4
- data/spec/unit/resource/file/verification_spec.rb +11 -11
- data/spec/unit/resource/file_spec.rb +10 -10
- data/spec/unit/resource/freebsd_package_spec.rb +6 -9
- data/spec/unit/resource/gem_package_spec.rb +4 -4
- data/spec/unit/resource/git_spec.rb +3 -3
- data/spec/unit/resource/group_spec.rb +4 -4
- data/spec/unit/resource/homebrew_package_spec.rb +13 -13
- data/spec/unit/resource/http_request_spec.rb +5 -5
- data/spec/unit/resource/ifconfig_spec.rb +9 -9
- data/spec/unit/resource/ips_package_spec.rb +4 -4
- data/spec/unit/resource/ksh_spec.rb +2 -2
- data/spec/unit/resource/link_spec.rb +6 -6
- data/spec/unit/resource/log_spec.rb +3 -3
- data/spec/unit/resource/macports_package_spec.rb +3 -3
- data/spec/unit/resource/mdadm_spec.rb +3 -3
- data/spec/unit/resource/mount_spec.rb +7 -7
- data/spec/unit/resource/ohai_spec.rb +2 -3
- data/spec/unit/resource/openbsd_package_spec.rb +5 -6
- data/spec/unit/resource/osx_profile_spec.rb +61 -0
- data/spec/unit/resource/package_spec.rb +6 -6
- data/spec/unit/resource/pacman_package_spec.rb +3 -3
- data/spec/unit/resource/perl_spec.rb +3 -3
- data/spec/unit/resource/portage_package_spec.rb +2 -2
- data/spec/unit/resource/powershell_script_spec.rb +16 -16
- data/spec/unit/resource/python_spec.rb +3 -3
- data/spec/unit/resource/registry_key_spec.rb +21 -21
- data/spec/unit/resource/remote_directory_spec.rb +3 -3
- data/spec/unit/resource/remote_file_spec.rb +15 -15
- data/spec/unit/resource/resource_notification_spec.rb +18 -18
- data/spec/unit/resource/route_spec.rb +3 -3
- data/spec/unit/resource/rpm_package_spec.rb +4 -4
- data/spec/unit/resource/ruby_block_spec.rb +4 -4
- data/spec/unit/resource/ruby_spec.rb +3 -3
- data/spec/unit/resource/scm_spec.rb +8 -8
- data/spec/unit/resource/script_spec.rb +4 -4
- data/spec/unit/resource/service_spec.rb +4 -5
- data/spec/unit/resource/smartos_package_spec.rb +3 -3
- data/spec/unit/resource/solaris_package_spec.rb +3 -3
- data/spec/unit/resource/subversion_spec.rb +5 -5
- data/spec/unit/resource/template_spec.rb +7 -8
- data/spec/unit/resource/timestamped_deploy_spec.rb +4 -4
- data/spec/unit/resource/user_spec.rb +4 -4
- data/spec/unit/resource/windows_package_spec.rb +7 -7
- data/spec/unit/resource/windows_service_spec.rb +3 -3
- data/spec/unit/resource/yum_package_spec.rb +6 -6
- data/spec/unit/resource_collection/resource_list_spec.rb +7 -7
- data/spec/unit/resource_collection/resource_set_spec.rb +9 -9
- data/spec/unit/resource_collection/stepable_iterator_spec.rb +6 -6
- data/spec/unit/resource_collection_spec.rb +8 -9
- data/spec/unit/resource_definition_spec.rb +3 -3
- data/spec/unit/resource_reporter_spec.rb +56 -64
- data/spec/unit/resource_resolver_spec.rb +5 -6
- data/spec/unit/resource_spec.rb +80 -60
- data/spec/unit/rest/auth_credentials_spec.rb +39 -71
- data/spec/unit/rest_spec.rb +96 -90
- data/spec/unit/role_spec.rb +64 -68
- data/spec/unit/run_context/child_run_context_spec.rb +23 -23
- data/spec/unit/run_context/cookbook_compiler_spec.rb +5 -7
- data/spec/unit/run_context_spec.rb +19 -19
- data/spec/unit/run_list/run_list_expansion_spec.rb +24 -24
- data/spec/unit/run_list/run_list_item_spec.rb +28 -28
- data/spec/unit/run_list/versioned_recipe_list_spec.rb +22 -23
- data/spec/unit/run_list_spec.rb +37 -41
- data/spec/unit/run_lock_spec.rb +10 -10
- data/spec/unit/run_status_spec.rb +4 -5
- data/spec/unit/runner_spec.rb +8 -8
- data/spec/unit/scan_access_control_spec.rb +4 -5
- data/spec/unit/search/query_spec.rb +50 -46
- data/spec/unit/shell/model_wrapper_spec.rb +12 -13
- data/spec/unit/shell/shell_ext_spec.rb +5 -5
- data/spec/unit/shell/shell_session_spec.rb +8 -9
- data/spec/unit/shell_out_spec.rb +1 -1
- data/spec/unit/shell_spec.rb +9 -9
- data/spec/unit/user_spec.rb +14 -15
- data/spec/unit/user_v1_spec.rb +22 -23
- data/spec/unit/util/backup_spec.rb +17 -18
- data/spec/unit/util/diff_spec.rb +6 -9
- data/spec/unit/util/dsc/configuration_generator_spec.rb +48 -48
- data/spec/unit/util/dsc/lcm_output_parser_spec.rb +22 -22
- data/spec/unit/util/dsc/local_configuration_manager_spec.rb +30 -31
- data/spec/unit/util/dsc/resource_store.rb +22 -22
- data/spec/unit/util/editor_spec.rb +65 -65
- data/spec/unit/util/file_edit_spec.rb +7 -7
- data/spec/unit/util/powershell/cmdlet_spec.rb +27 -27
- data/spec/unit/util/powershell/ps_credential_spec.rb +13 -13
- data/spec/unit/util/selinux_spec.rb +8 -9
- data/spec/unit/util/threaded_job_queue_spec.rb +2 -2
- data/spec/unit/version/platform_spec.rb +5 -6
- data/spec/unit/version_class_spec.rb +8 -9
- data/spec/unit/version_constraint/platform_spec.rb +3 -4
- data/spec/unit/version_constraint_spec.rb +19 -19
- data/spec/unit/win32/registry_spec.rb +25 -25
- data/spec/unit/windows_service_spec.rb +20 -20
- data/tasks/cbgb.rb +84 -0
- data/tasks/external_tests.rb +12 -11
- data/tasks/maintainers.rb +15 -15
- data/tasks/rspec.rb +18 -15
- metadata +250 -67
- data/lib/chef/chef_fs/file_system/acl_dir.rb +0 -63
- data/lib/chef/chef_fs/file_system/acl_entry.rb +0 -58
- data/lib/chef/chef_fs/file_system/acls_dir.rb +0 -72
- data/lib/chef/chef_fs/file_system/chef_repository_file_system_cookbook_dir.rb +0 -102
- data/lib/chef/chef_fs/file_system/chef_repository_file_system_cookbook_entry.rb +0 -80
- data/lib/chef/chef_fs/file_system/chef_repository_file_system_cookbooks_dir.rb +0 -82
- data/lib/chef/chef_fs/file_system/chef_repository_file_system_entry.rb +0 -81
- data/lib/chef/chef_fs/file_system/chef_repository_file_system_root_dir.rb +0 -196
- data/lib/chef/chef_fs/file_system/chef_server_root_dir.rb +0 -165
- data/lib/chef/chef_fs/file_system/cookbook_dir.rb +0 -224
- data/lib/chef/chef_fs/file_system/cookbook_file.rb +0 -82
- data/lib/chef/chef_fs/file_system/cookbook_subdir.rb +0 -59
- data/lib/chef/chef_fs/file_system/cookbooks_acl_dir.rb +0 -41
- data/lib/chef/chef_fs/file_system/cookbooks_dir.rb +0 -156
- data/lib/chef/chef_fs/file_system/data_bag_dir.rb +0 -69
- data/lib/chef/chef_fs/file_system/data_bags_dir.rb +0 -71
- data/lib/chef/chef_fs/file_system/environments_dir.rb +0 -60
- data/lib/chef/chef_fs/file_system/file_system_entry.rb +0 -115
- data/lib/chef/chef_fs/file_system/memory_dir.rb +0 -51
- data/lib/chef/chef_fs/file_system/memory_file.rb +0 -17
- data/lib/chef/chef_fs/file_system/memory_root.rb +0 -21
- data/lib/chef/chef_fs/file_system/nodes_dir.rb +0 -55
- data/lib/chef/chef_fs/file_system/org_entry.rb +0 -34
- data/lib/chef/chef_fs/file_system/organization_invites_entry.rb +0 -59
- data/lib/chef/chef_fs/file_system/organization_members_entry.rb +0 -58
- data/lib/chef/chef_fs/file_system/rest_list_dir.rb +0 -110
- data/lib/chef/chef_fs/file_system/rest_list_entry.rb +0 -185
@@ -1,6 +1,6 @@
|
|
1
1
|
#
|
2
|
-
# Author:: John Keiser (<jkeiser@
|
3
|
-
# Copyright:: Copyright
|
2
|
+
# Author:: John Keiser (<jkeiser@chef.io>)
|
3
|
+
# Copyright:: Copyright 2013-2016, Chef Software Inc.
|
4
4
|
# License:: Apache License, Version 2.0
|
5
5
|
#
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -15,40 +15,40 @@
|
|
15
15
|
# See the License for the specific language governing permissions and
|
16
16
|
# limitations under the License.
|
17
17
|
|
18
|
-
require
|
19
|
-
require
|
20
|
-
require
|
18
|
+
require "support/shared/integration/integration_helper"
|
19
|
+
require "chef/knife/download"
|
20
|
+
require "chef/knife/diff"
|
21
21
|
|
22
|
-
describe
|
22
|
+
describe "knife download", :workstation do
|
23
23
|
include IntegrationSupport
|
24
24
|
include KnifeSupport
|
25
25
|
|
26
|
-
context
|
26
|
+
context "without versioned cookbooks" do
|
27
27
|
when_the_chef_server "has one of each thing" do
|
28
28
|
|
29
29
|
before do
|
30
|
-
client
|
31
|
-
cookbook
|
32
|
-
data_bag
|
33
|
-
environment
|
34
|
-
node
|
35
|
-
role
|
36
|
-
user
|
30
|
+
client "x", {}
|
31
|
+
cookbook "x", "1.0.0"
|
32
|
+
data_bag "x", { "y" => {} }
|
33
|
+
environment "x", {}
|
34
|
+
node "x", {}
|
35
|
+
role "x", {}
|
36
|
+
user "x", {}
|
37
37
|
end
|
38
38
|
|
39
|
-
when_the_repository
|
39
|
+
when_the_repository "has only top-level directories" do
|
40
40
|
before do
|
41
|
-
directory
|
42
|
-
directory
|
43
|
-
directory
|
44
|
-
directory
|
45
|
-
directory
|
46
|
-
directory
|
47
|
-
directory
|
41
|
+
directory "clients"
|
42
|
+
directory "cookbooks"
|
43
|
+
directory "data_bags"
|
44
|
+
directory "environments"
|
45
|
+
directory "nodes"
|
46
|
+
directory "roles"
|
47
|
+
directory "users"
|
48
48
|
end
|
49
49
|
|
50
|
-
it
|
51
|
-
knife(
|
50
|
+
it "knife download downloads everything" do
|
51
|
+
knife("download /").should_succeed <<EOM
|
52
52
|
Created /clients/chef-validator.json
|
53
53
|
Created /clients/chef-webui.json
|
54
54
|
Created /clients/x.json
|
@@ -63,38 +63,38 @@ Created /roles/x.json
|
|
63
63
|
Created /users/admin.json
|
64
64
|
Created /users/x.json
|
65
65
|
EOM
|
66
|
-
knife(
|
66
|
+
knife("diff --name-status /").should_succeed ""
|
67
67
|
end
|
68
68
|
end
|
69
69
|
|
70
|
-
when_the_repository
|
70
|
+
when_the_repository "has an identical copy of each thing" do
|
71
71
|
before do
|
72
|
-
file
|
73
|
-
file
|
74
|
-
file
|
75
|
-
file
|
76
|
-
file
|
77
|
-
file
|
78
|
-
file
|
79
|
-
file
|
80
|
-
file
|
81
|
-
file
|
82
|
-
file
|
72
|
+
file "clients/chef-validator.json", { "validator" => true, "public_key" => ChefZero::PUBLIC_KEY }
|
73
|
+
file "clients/chef-webui.json", { "admin" => true, "public_key" => ChefZero::PUBLIC_KEY }
|
74
|
+
file "clients/x.json", { "public_key" => ChefZero::PUBLIC_KEY }
|
75
|
+
file "cookbooks/x/metadata.rb", cb_metadata("x", "1.0.0")
|
76
|
+
file "data_bags/x/y.json", {}
|
77
|
+
file "environments/_default.json", { "description" => "The default Chef environment" }
|
78
|
+
file "environments/x.json", {}
|
79
|
+
file "nodes/x.json", {}
|
80
|
+
file "roles/x.json", {}
|
81
|
+
file "users/admin.json", { "admin" => true, "public_key" => ChefZero::PUBLIC_KEY }
|
82
|
+
file "users/x.json", { "public_key" => ChefZero::PUBLIC_KEY }
|
83
83
|
end
|
84
84
|
|
85
|
-
it
|
86
|
-
knife(
|
87
|
-
knife(
|
85
|
+
it "knife download makes no changes" do
|
86
|
+
knife("download /").should_succeed ""
|
87
|
+
knife("diff --name-status /").should_succeed ""
|
88
88
|
end
|
89
89
|
|
90
|
-
it
|
91
|
-
knife(
|
92
|
-
knife(
|
90
|
+
it "knife download --purge makes no changes" do
|
91
|
+
knife("download --purge /").should_succeed ""
|
92
|
+
knife("diff --name-status /").should_succeed ""
|
93
93
|
end
|
94
94
|
|
95
|
-
context
|
95
|
+
context "except the role file" do
|
96
96
|
before do
|
97
|
-
file
|
97
|
+
file "roles/x.json", <<EOM
|
98
98
|
{
|
99
99
|
"chef_type": "role",
|
100
100
|
"default_attributes": {
|
@@ -113,20 +113,20 @@ EOM
|
|
113
113
|
EOM
|
114
114
|
end
|
115
115
|
|
116
|
-
it
|
117
|
-
knife(
|
118
|
-
knife(
|
116
|
+
it "knife download changes the role" do
|
117
|
+
knife("download /").should_succeed "Updated /roles/x.json\n"
|
118
|
+
knife("diff --name-status /").should_succeed ""
|
119
119
|
end
|
120
120
|
|
121
|
-
it
|
122
|
-
knife(
|
123
|
-
knife(
|
121
|
+
it "knife download --no-diff does not change the role" do
|
122
|
+
knife("download --no-diff /").should_succeed ""
|
123
|
+
knife("diff --name-status /").should_succeed "M\t/roles/x.json\n"
|
124
124
|
end
|
125
125
|
end
|
126
126
|
|
127
|
-
context
|
127
|
+
context "except the role file is textually different, but not ACTUALLY different" do
|
128
128
|
before do
|
129
|
-
file
|
129
|
+
file "roles/x.json", <<EOM
|
130
130
|
{
|
131
131
|
"chef_type": "role",
|
132
132
|
"default_attributes": {
|
@@ -145,28 +145,28 @@ EOM
|
|
145
145
|
EOM
|
146
146
|
end
|
147
147
|
|
148
|
-
it
|
149
|
-
knife(
|
150
|
-
knife(
|
148
|
+
it "knife download / does not change anything" do
|
149
|
+
knife("download /").should_succeed ""
|
150
|
+
knife("diff --name-status /").should_succeed ""
|
151
151
|
end
|
152
152
|
end
|
153
153
|
|
154
|
-
context
|
154
|
+
context "as well as one extra copy of each thing" do
|
155
155
|
before do
|
156
|
-
file
|
157
|
-
file
|
158
|
-
file
|
159
|
-
file
|
160
|
-
file
|
161
|
-
file
|
162
|
-
file
|
163
|
-
file
|
164
|
-
file
|
156
|
+
file "clients/y.json", { "public_key" => ChefZero::PUBLIC_KEY }
|
157
|
+
file "cookbooks/x/blah.rb", ""
|
158
|
+
file "cookbooks/y/metadata.rb", cb_metadata("x", "1.0.0")
|
159
|
+
file "data_bags/x/z.json", {}
|
160
|
+
file "data_bags/y/zz.json", {}
|
161
|
+
file "environments/y.json", {}
|
162
|
+
file "nodes/y.json", {}
|
163
|
+
file "roles/y.json", {}
|
164
|
+
file "users/y.json", { "public_key" => ChefZero::PUBLIC_KEY }
|
165
165
|
end
|
166
166
|
|
167
|
-
it
|
168
|
-
knife(
|
169
|
-
knife(
|
167
|
+
it "knife download does nothing" do
|
168
|
+
knife("download /").should_succeed ""
|
169
|
+
knife("diff --name-status /").should_succeed <<EOM
|
170
170
|
A\t/clients/y.json
|
171
171
|
A\t/cookbooks/x/blah.rb
|
172
172
|
A\t/cookbooks/y
|
@@ -179,8 +179,8 @@ A\t/users/y.json
|
|
179
179
|
EOM
|
180
180
|
end
|
181
181
|
|
182
|
-
it
|
183
|
-
knife(
|
182
|
+
it "knife download --purge deletes the extra files" do
|
183
|
+
knife("download --purge /").should_succeed <<EOM
|
184
184
|
Deleted extra entry /clients/y.json (purge is on)
|
185
185
|
Deleted extra entry /cookbooks/x/blah.rb (purge is on)
|
186
186
|
Deleted extra entry /cookbooks/y (purge is on)
|
@@ -191,14 +191,14 @@ Deleted extra entry /nodes/y.json (purge is on)
|
|
191
191
|
Deleted extra entry /roles/y.json (purge is on)
|
192
192
|
Deleted extra entry /users/y.json (purge is on)
|
193
193
|
EOM
|
194
|
-
knife(
|
194
|
+
knife("diff --name-status /").should_succeed ""
|
195
195
|
end
|
196
196
|
end
|
197
197
|
end
|
198
198
|
|
199
|
-
when_the_repository
|
200
|
-
it
|
201
|
-
knife(
|
199
|
+
when_the_repository "is empty" do
|
200
|
+
it "knife download creates the extra files" do
|
201
|
+
knife("download /").should_succeed <<EOM
|
202
202
|
Created /clients
|
203
203
|
Created /clients/chef-validator.json
|
204
204
|
Created /clients/chef-webui.json
|
@@ -220,11 +220,11 @@ Created /users
|
|
220
220
|
Created /users/admin.json
|
221
221
|
Created /users/x.json
|
222
222
|
EOM
|
223
|
-
knife(
|
223
|
+
knife("diff --name-status /").should_succeed ""
|
224
224
|
end
|
225
225
|
|
226
|
-
it
|
227
|
-
knife(
|
226
|
+
it "knife download --no-diff creates the extra files" do
|
227
|
+
knife("download --no-diff /").should_succeed <<EOM
|
228
228
|
Created /clients
|
229
229
|
Created /clients/chef-validator.json
|
230
230
|
Created /clients/chef-webui.json
|
@@ -246,41 +246,41 @@ Created /users
|
|
246
246
|
Created /users/admin.json
|
247
247
|
Created /users/x.json
|
248
248
|
EOM
|
249
|
-
knife(
|
249
|
+
knife("diff --name-status /").should_succeed ""
|
250
250
|
end
|
251
251
|
|
252
|
-
context
|
252
|
+
context "when current directory is top level" do
|
253
253
|
before do
|
254
|
-
cwd
|
254
|
+
cwd "."
|
255
255
|
end
|
256
256
|
|
257
|
-
it
|
258
|
-
knife(
|
257
|
+
it "knife download with no parameters reports an error" do
|
258
|
+
knife("download").should_fail "FATAL: Must specify at least one argument. If you want to download everything in this directory, type \"knife download .\"\n", :stdout => /USAGE/
|
259
259
|
end
|
260
260
|
end
|
261
261
|
end
|
262
262
|
end
|
263
263
|
|
264
264
|
# Test download of an item when the other end doesn't even have the container
|
265
|
-
when_the_repository
|
266
|
-
when_the_chef_server
|
265
|
+
when_the_repository "is empty" do
|
266
|
+
when_the_chef_server "has two data bag items" do
|
267
267
|
before do
|
268
|
-
data_bag
|
268
|
+
data_bag "x", { "y" => {}, "z" => {} }
|
269
269
|
end
|
270
270
|
|
271
|
-
it
|
272
|
-
knife(
|
271
|
+
it "knife download of one data bag item itself succeeds" do
|
272
|
+
knife("download /data_bags/x/y.json").should_succeed <<EOM
|
273
273
|
Created /data_bags
|
274
274
|
Created /data_bags/x
|
275
275
|
Created /data_bags/x/y.json
|
276
276
|
EOM
|
277
|
-
knife(
|
277
|
+
knife("diff --name-status /data_bags").should_succeed <<EOM
|
278
278
|
D\t/data_bags/x/z.json
|
279
279
|
EOM
|
280
280
|
end
|
281
281
|
|
282
|
-
it
|
283
|
-
knife(
|
282
|
+
it "knife download /data_bags/x /data_bags/x/y.json downloads x once" do
|
283
|
+
knife("download /data_bags/x /data_bags/x/y.json").should_succeed <<EOM
|
284
284
|
Created /data_bags
|
285
285
|
Created /data_bags/x
|
286
286
|
Created /data_bags/x/y.json
|
@@ -290,285 +290,285 @@ EOM
|
|
290
290
|
end
|
291
291
|
end
|
292
292
|
|
293
|
-
when_the_repository
|
293
|
+
when_the_repository "has three data bag items" do
|
294
294
|
before do
|
295
|
-
file
|
295
|
+
file "data_bags/x/deleted.json", <<EOM
|
296
296
|
{
|
297
297
|
"id": "deleted"
|
298
298
|
}
|
299
299
|
EOM
|
300
|
-
file
|
300
|
+
file "data_bags/x/modified.json", <<EOM
|
301
301
|
{
|
302
302
|
"id": "modified"
|
303
303
|
}
|
304
304
|
EOM
|
305
|
-
file
|
305
|
+
file "data_bags/x/unmodified.json", <<EOM
|
306
306
|
{
|
307
307
|
"id": "unmodified"
|
308
308
|
}
|
309
309
|
EOM
|
310
310
|
end
|
311
311
|
|
312
|
-
when_the_chef_server
|
312
|
+
when_the_chef_server "has a modified, unmodified, added and deleted data bag item" do
|
313
313
|
before do
|
314
|
-
data_bag
|
315
|
-
|
316
|
-
|
317
|
-
|
314
|
+
data_bag "x", {
|
315
|
+
"added" => {},
|
316
|
+
"modified" => { "foo" => "bar" },
|
317
|
+
"unmodified" => {},
|
318
318
|
}
|
319
319
|
end
|
320
320
|
|
321
|
-
it
|
322
|
-
knife(
|
321
|
+
it "knife download of the modified file succeeds" do
|
322
|
+
knife("download /data_bags/x/modified.json").should_succeed <<EOM
|
323
323
|
Updated /data_bags/x/modified.json
|
324
324
|
EOM
|
325
|
-
knife(
|
325
|
+
knife("diff --name-status /data_bags").should_succeed <<EOM
|
326
326
|
D\t/data_bags/x/added.json
|
327
327
|
A\t/data_bags/x/deleted.json
|
328
328
|
EOM
|
329
329
|
end
|
330
|
-
it
|
331
|
-
knife(
|
332
|
-
knife(
|
330
|
+
it "knife download of the unmodified file does nothing" do
|
331
|
+
knife("download /data_bags/x/unmodified.json").should_succeed ""
|
332
|
+
knife("diff --name-status /data_bags").should_succeed <<EOM
|
333
333
|
D\t/data_bags/x/added.json
|
334
334
|
M\t/data_bags/x/modified.json
|
335
335
|
A\t/data_bags/x/deleted.json
|
336
336
|
EOM
|
337
337
|
end
|
338
|
-
it
|
339
|
-
knife(
|
338
|
+
it "knife download of the added file succeeds" do
|
339
|
+
knife("download /data_bags/x/added.json").should_succeed <<EOM
|
340
340
|
Created /data_bags/x/added.json
|
341
341
|
EOM
|
342
|
-
knife(
|
342
|
+
knife("diff --name-status /data_bags").should_succeed <<EOM
|
343
343
|
M\t/data_bags/x/modified.json
|
344
344
|
A\t/data_bags/x/deleted.json
|
345
345
|
EOM
|
346
346
|
end
|
347
|
-
it
|
348
|
-
knife(
|
349
|
-
knife(
|
347
|
+
it "knife download of the deleted file does nothing" do
|
348
|
+
knife("download /data_bags/x/deleted.json").should_succeed ""
|
349
|
+
knife("diff --name-status /data_bags").should_succeed <<EOM
|
350
350
|
D\t/data_bags/x/added.json
|
351
351
|
M\t/data_bags/x/modified.json
|
352
352
|
A\t/data_bags/x/deleted.json
|
353
353
|
EOM
|
354
354
|
end
|
355
|
-
it
|
356
|
-
knife(
|
355
|
+
it "knife download --purge of the deleted file deletes it" do
|
356
|
+
knife("download --purge /data_bags/x/deleted.json").should_succeed <<EOM
|
357
357
|
Deleted extra entry /data_bags/x/deleted.json (purge is on)
|
358
358
|
EOM
|
359
|
-
knife(
|
359
|
+
knife("diff --name-status /data_bags").should_succeed <<EOM
|
360
360
|
D\t/data_bags/x/added.json
|
361
361
|
M\t/data_bags/x/modified.json
|
362
362
|
EOM
|
363
363
|
end
|
364
|
-
it
|
365
|
-
knife(
|
364
|
+
it "knife download of the entire data bag downloads everything" do
|
365
|
+
knife("download /data_bags/x").should_succeed <<EOM
|
366
366
|
Created /data_bags/x/added.json
|
367
367
|
Updated /data_bags/x/modified.json
|
368
368
|
EOM
|
369
|
-
knife(
|
369
|
+
knife("diff --name-status /data_bags").should_succeed <<EOM
|
370
370
|
A\t/data_bags/x/deleted.json
|
371
371
|
EOM
|
372
372
|
end
|
373
|
-
it
|
374
|
-
knife(
|
373
|
+
it "knife download --purge of the entire data bag downloads everything" do
|
374
|
+
knife("download --purge /data_bags/x").should_succeed <<EOM
|
375
375
|
Created /data_bags/x/added.json
|
376
376
|
Updated /data_bags/x/modified.json
|
377
377
|
Deleted extra entry /data_bags/x/deleted.json (purge is on)
|
378
378
|
EOM
|
379
|
-
knife(
|
379
|
+
knife("diff --name-status /data_bags").should_succeed ""
|
380
380
|
end
|
381
|
-
context
|
381
|
+
context "when cwd is the /data_bags directory" do
|
382
382
|
before do
|
383
|
-
cwd
|
383
|
+
cwd "data_bags"
|
384
384
|
end
|
385
|
-
it
|
386
|
-
knife(
|
385
|
+
it "knife download fails" do
|
386
|
+
knife("download").should_fail "FATAL: Must specify at least one argument. If you want to download everything in this directory, type \"knife download .\"\n", :stdout => /USAGE/
|
387
387
|
end
|
388
|
-
it
|
389
|
-
knife(
|
388
|
+
it "knife download --purge . downloads everything" do
|
389
|
+
knife("download --purge .").should_succeed <<EOM
|
390
390
|
Created x/added.json
|
391
391
|
Updated x/modified.json
|
392
392
|
Deleted extra entry x/deleted.json (purge is on)
|
393
393
|
EOM
|
394
|
-
knife(
|
394
|
+
knife("diff --name-status /data_bags").should_succeed ""
|
395
395
|
end
|
396
|
-
it
|
397
|
-
knife(
|
396
|
+
it "knife download --purge * downloads everything" do
|
397
|
+
knife("download --purge *").should_succeed <<EOM
|
398
398
|
Created x/added.json
|
399
399
|
Updated x/modified.json
|
400
400
|
Deleted extra entry x/deleted.json (purge is on)
|
401
401
|
EOM
|
402
|
-
knife(
|
402
|
+
knife("diff --name-status /data_bags").should_succeed ""
|
403
403
|
end
|
404
404
|
end
|
405
405
|
end
|
406
406
|
end
|
407
407
|
|
408
|
-
when_the_repository
|
408
|
+
when_the_repository "has a cookbook" do
|
409
409
|
before do
|
410
|
-
file
|
411
|
-
file
|
410
|
+
file "cookbooks/x/metadata.rb", cb_metadata("x", "1.0.0")
|
411
|
+
file "cookbooks/x/z.rb", ""
|
412
412
|
end
|
413
413
|
|
414
|
-
when_the_chef_server
|
414
|
+
when_the_chef_server "has a modified, added and deleted file for the cookbook" do
|
415
415
|
before do
|
416
|
-
cookbook
|
416
|
+
cookbook "x", "1.0.0", { "metadata.rb" => cb_metadata("x", "1.0.0", "#extra content"), "y.rb" => "hi" }
|
417
417
|
end
|
418
418
|
|
419
|
-
it
|
420
|
-
knife(
|
421
|
-
knife(
|
419
|
+
it "knife download of a modified file succeeds" do
|
420
|
+
knife("download /cookbooks/x/metadata.rb").should_succeed "Updated /cookbooks/x/metadata.rb\n"
|
421
|
+
knife("diff --name-status /cookbooks").should_succeed <<EOM
|
422
422
|
D\t/cookbooks/x/y.rb
|
423
423
|
A\t/cookbooks/x/z.rb
|
424
424
|
EOM
|
425
425
|
end
|
426
|
-
it
|
427
|
-
knife(
|
428
|
-
knife(
|
426
|
+
it "knife download of a deleted file does nothing" do
|
427
|
+
knife("download /cookbooks/x/z.rb").should_succeed ""
|
428
|
+
knife("diff --name-status /cookbooks").should_succeed <<EOM
|
429
429
|
M\t/cookbooks/x/metadata.rb
|
430
430
|
D\t/cookbooks/x/y.rb
|
431
431
|
A\t/cookbooks/x/z.rb
|
432
432
|
EOM
|
433
433
|
end
|
434
|
-
it
|
435
|
-
knife(
|
436
|
-
knife(
|
434
|
+
it "knife download --purge of a deleted file succeeds" do
|
435
|
+
knife("download --purge /cookbooks/x/z.rb").should_succeed "Deleted extra entry /cookbooks/x/z.rb (purge is on)\n"
|
436
|
+
knife("diff --name-status /cookbooks").should_succeed <<EOM
|
437
437
|
M\t/cookbooks/x/metadata.rb
|
438
438
|
D\t/cookbooks/x/y.rb
|
439
439
|
EOM
|
440
440
|
end
|
441
|
-
it
|
442
|
-
knife(
|
443
|
-
knife(
|
441
|
+
it "knife download of an added file succeeds" do
|
442
|
+
knife("download /cookbooks/x/y.rb").should_succeed "Created /cookbooks/x/y.rb\n"
|
443
|
+
knife("diff --name-status /cookbooks").should_succeed <<EOM
|
444
444
|
M\t/cookbooks/x/metadata.rb
|
445
445
|
A\t/cookbooks/x/z.rb
|
446
446
|
EOM
|
447
447
|
end
|
448
|
-
it
|
449
|
-
knife(
|
448
|
+
it "knife download of the cookbook itself succeeds" do
|
449
|
+
knife("download /cookbooks/x").should_succeed <<EOM
|
450
450
|
Updated /cookbooks/x/metadata.rb
|
451
451
|
Created /cookbooks/x/y.rb
|
452
452
|
EOM
|
453
|
-
knife(
|
453
|
+
knife("diff --name-status /cookbooks").should_succeed <<EOM
|
454
454
|
A\t/cookbooks/x/z.rb
|
455
455
|
EOM
|
456
456
|
end
|
457
|
-
it
|
458
|
-
knife(
|
457
|
+
it "knife download --purge of the cookbook itself succeeds" do
|
458
|
+
knife("download --purge /cookbooks/x").should_succeed <<EOM
|
459
459
|
Updated /cookbooks/x/metadata.rb
|
460
460
|
Created /cookbooks/x/y.rb
|
461
461
|
Deleted extra entry /cookbooks/x/z.rb (purge is on)
|
462
462
|
EOM
|
463
|
-
knife(
|
463
|
+
knife("diff --name-status /cookbooks").should_succeed ""
|
464
464
|
end
|
465
465
|
end
|
466
466
|
end
|
467
467
|
|
468
|
-
when_the_repository
|
468
|
+
when_the_repository "has a cookbook" do
|
469
469
|
before do
|
470
|
-
file
|
471
|
-
file
|
470
|
+
file "cookbooks/x/metadata.rb", cb_metadata("x", "1.0.0")
|
471
|
+
file "cookbooks/x/onlyin1.0.0.rb", "old_text"
|
472
472
|
end
|
473
473
|
|
474
|
-
when_the_chef_server
|
474
|
+
when_the_chef_server "has a later version for the cookbook" do
|
475
475
|
before do
|
476
|
-
cookbook
|
477
|
-
cookbook
|
476
|
+
cookbook "x", "1.0.0", { "onlyin1.0.0.rb" => "" }
|
477
|
+
cookbook "x", "1.0.1", { "onlyin1.0.1.rb" => "hi" }
|
478
478
|
end
|
479
479
|
|
480
|
-
it
|
481
|
-
knife(
|
480
|
+
it "knife download /cookbooks/x downloads the latest version" do
|
481
|
+
knife("download --purge /cookbooks/x").should_succeed <<EOM
|
482
482
|
Updated /cookbooks/x/metadata.rb
|
483
483
|
Created /cookbooks/x/onlyin1.0.1.rb
|
484
484
|
Deleted extra entry /cookbooks/x/onlyin1.0.0.rb (purge is on)
|
485
485
|
EOM
|
486
|
-
knife(
|
486
|
+
knife("diff --name-status /cookbooks").should_succeed ""
|
487
487
|
end
|
488
488
|
end
|
489
489
|
|
490
|
-
when_the_chef_server
|
490
|
+
when_the_chef_server "has an earlier version for the cookbook" do
|
491
491
|
before do
|
492
|
-
cookbook
|
493
|
-
cookbook
|
492
|
+
cookbook "x", "1.0.0", { "onlyin1.0.0.rb" => "" }
|
493
|
+
cookbook "x", "0.9.9", { "onlyin0.9.9.rb" => "hi" }
|
494
494
|
end
|
495
495
|
|
496
|
-
it
|
497
|
-
knife(
|
496
|
+
it "knife download /cookbooks/x downloads the updated file" do
|
497
|
+
knife("download --purge /cookbooks/x").should_succeed <<EOM
|
498
498
|
Updated /cookbooks/x/onlyin1.0.0.rb
|
499
499
|
EOM
|
500
|
-
knife(
|
500
|
+
knife("diff --name-status /cookbooks").should_succeed ""
|
501
501
|
end
|
502
502
|
end
|
503
503
|
|
504
|
-
when_the_chef_server
|
504
|
+
when_the_chef_server "has a later version for the cookbook, and no current version" do
|
505
505
|
before do
|
506
|
-
cookbook
|
506
|
+
cookbook "x", "1.0.1", { "onlyin1.0.1.rb" => "hi" }
|
507
507
|
end
|
508
508
|
|
509
|
-
it
|
510
|
-
knife(
|
509
|
+
it "knife download /cookbooks/x downloads the latest version" do
|
510
|
+
knife("download --purge /cookbooks/x").should_succeed <<EOM
|
511
511
|
Updated /cookbooks/x/metadata.rb
|
512
512
|
Created /cookbooks/x/onlyin1.0.1.rb
|
513
513
|
Deleted extra entry /cookbooks/x/onlyin1.0.0.rb (purge is on)
|
514
514
|
EOM
|
515
|
-
knife(
|
515
|
+
knife("diff --name-status /cookbooks").should_succeed ""
|
516
516
|
end
|
517
517
|
end
|
518
518
|
|
519
|
-
when_the_chef_server
|
519
|
+
when_the_chef_server "has an earlier version for the cookbook, and no current version" do
|
520
520
|
before do
|
521
|
-
cookbook
|
521
|
+
cookbook "x", "0.9.9", { "onlyin0.9.9.rb" => "hi" }
|
522
522
|
end
|
523
523
|
|
524
|
-
it
|
525
|
-
knife(
|
524
|
+
it "knife download /cookbooks/x downloads the old version" do
|
525
|
+
knife("download --purge /cookbooks/x").should_succeed <<EOM
|
526
526
|
Updated /cookbooks/x/metadata.rb
|
527
527
|
Created /cookbooks/x/onlyin0.9.9.rb
|
528
528
|
Deleted extra entry /cookbooks/x/onlyin1.0.0.rb (purge is on)
|
529
529
|
EOM
|
530
|
-
knife(
|
530
|
+
knife("diff --name-status /cookbooks").should_succeed ""
|
531
531
|
end
|
532
532
|
end
|
533
533
|
end
|
534
534
|
|
535
|
-
when_the_chef_server
|
535
|
+
when_the_chef_server "has an environment" do
|
536
536
|
before do
|
537
|
-
environment
|
537
|
+
environment "x", {}
|
538
538
|
end
|
539
|
-
when_the_repository
|
539
|
+
when_the_repository "has an environment with bad JSON" do
|
540
540
|
before do
|
541
|
-
file
|
541
|
+
file "environments/x.json", "{"
|
542
542
|
end
|
543
|
-
it
|
543
|
+
it "knife download succeeds" do
|
544
544
|
warning = <<-EOH
|
545
545
|
WARN: Parse error reading #{path_to('environments/x.json')} as JSON: parse error: premature EOF
|
546
546
|
{
|
547
547
|
(right here) ------^
|
548
548
|
|
549
549
|
EOH
|
550
|
-
knife(
|
551
|
-
knife(
|
550
|
+
knife("download /environments/x.json").should_succeed "Updated /environments/x.json\n", :stderr => warning
|
551
|
+
knife("diff --name-status /environments/x.json").should_succeed ""
|
552
552
|
end
|
553
553
|
end
|
554
554
|
|
555
|
-
when_the_repository
|
555
|
+
when_the_repository "has the same environment with the wrong name in the file" do
|
556
556
|
before do
|
557
|
-
file
|
557
|
+
file "environments/x.json", { "name" => "y" }
|
558
558
|
end
|
559
|
-
it
|
560
|
-
knife(
|
561
|
-
knife(
|
559
|
+
it "knife download succeeds" do
|
560
|
+
knife("download /environments/x.json").should_succeed "Updated /environments/x.json\n"
|
561
|
+
knife("diff --name-status /environments/x.json").should_succeed ""
|
562
562
|
end
|
563
563
|
end
|
564
564
|
|
565
|
-
when_the_repository
|
565
|
+
when_the_repository "has the same environment with no name in the file" do
|
566
566
|
before do
|
567
|
-
file
|
567
|
+
file "environments/x.json", { "description" => "hi" }
|
568
568
|
end
|
569
|
-
it
|
570
|
-
knife(
|
571
|
-
knife(
|
569
|
+
it "knife download succeeds" do
|
570
|
+
knife("download /environments/x.json").should_succeed "Updated /environments/x.json\n"
|
571
|
+
knife("diff --name-status /environments/x.json").should_succeed ""
|
572
572
|
end
|
573
573
|
end
|
574
574
|
end
|
@@ -577,28 +577,28 @@ EOH
|
|
577
577
|
with_versioned_cookbooks do
|
578
578
|
when_the_chef_server "has one of each thing" do
|
579
579
|
before do
|
580
|
-
client
|
581
|
-
cookbook
|
582
|
-
data_bag
|
583
|
-
environment
|
584
|
-
node
|
585
|
-
role
|
586
|
-
user
|
580
|
+
client "x", {}
|
581
|
+
cookbook "x", "1.0.0"
|
582
|
+
data_bag "x", { "y" => {} }
|
583
|
+
environment "x", {}
|
584
|
+
node "x", {}
|
585
|
+
role "x", {}
|
586
|
+
user "x", {}
|
587
587
|
end
|
588
588
|
|
589
|
-
when_the_repository
|
589
|
+
when_the_repository "has only top-level directories" do
|
590
590
|
before do
|
591
|
-
directory
|
592
|
-
directory
|
593
|
-
directory
|
594
|
-
directory
|
595
|
-
directory
|
596
|
-
directory
|
597
|
-
directory
|
591
|
+
directory "clients"
|
592
|
+
directory "cookbooks"
|
593
|
+
directory "data_bags"
|
594
|
+
directory "environments"
|
595
|
+
directory "nodes"
|
596
|
+
directory "roles"
|
597
|
+
directory "users"
|
598
598
|
end
|
599
599
|
|
600
|
-
it
|
601
|
-
knife(
|
600
|
+
it "knife download downloads everything" do
|
601
|
+
knife("download /").should_succeed <<EOM
|
602
602
|
Created /clients/chef-validator.json
|
603
603
|
Created /clients/chef-webui.json
|
604
604
|
Created /clients/x.json
|
@@ -613,49 +613,49 @@ Created /roles/x.json
|
|
613
613
|
Created /users/admin.json
|
614
614
|
Created /users/x.json
|
615
615
|
EOM
|
616
|
-
knife(
|
616
|
+
knife("diff --name-status /").should_succeed ""
|
617
617
|
end
|
618
618
|
end
|
619
619
|
|
620
|
-
when_the_repository
|
620
|
+
when_the_repository "has an identical copy of each thing" do
|
621
621
|
before do
|
622
|
-
file
|
623
|
-
file
|
624
|
-
file
|
625
|
-
file
|
626
|
-
file
|
627
|
-
file
|
628
|
-
file
|
629
|
-
file
|
630
|
-
file
|
631
|
-
file
|
632
|
-
file
|
622
|
+
file "clients/chef-validator.json", { "validator" => true, "public_key" => ChefZero::PUBLIC_KEY }
|
623
|
+
file "clients/chef-webui.json", { "admin" => true, "public_key" => ChefZero::PUBLIC_KEY }
|
624
|
+
file "clients/x.json", { "public_key" => ChefZero::PUBLIC_KEY }
|
625
|
+
file "cookbooks/x-1.0.0/metadata.rb", cb_metadata("x", "1.0.0")
|
626
|
+
file "data_bags/x/y.json", {}
|
627
|
+
file "environments/_default.json", { "description" => "The default Chef environment" }
|
628
|
+
file "environments/x.json", {}
|
629
|
+
file "nodes/x.json", {}
|
630
|
+
file "roles/x.json", {}
|
631
|
+
file "users/admin.json", { "admin" => true, "public_key" => ChefZero::PUBLIC_KEY }
|
632
|
+
file "users/x.json", { "public_key" => ChefZero::PUBLIC_KEY }
|
633
633
|
end
|
634
634
|
|
635
|
-
it
|
636
|
-
knife(
|
637
|
-
knife(
|
635
|
+
it "knife download makes no changes" do
|
636
|
+
knife("download /").should_succeed ""
|
637
|
+
knife("diff --name-status /").should_succeed ""
|
638
638
|
end
|
639
639
|
|
640
|
-
it
|
641
|
-
knife(
|
642
|
-
knife(
|
640
|
+
it "knife download --purge makes no changes" do
|
641
|
+
knife("download --purge /").should_succeed ""
|
642
|
+
knife("diff --name-status /").should_succeed ""
|
643
643
|
end
|
644
644
|
|
645
|
-
context
|
645
|
+
context "except the role file" do
|
646
646
|
before do
|
647
|
-
file
|
647
|
+
file "roles/x.json", { "description" => "blarghle" }
|
648
648
|
end
|
649
649
|
|
650
|
-
it
|
651
|
-
knife(
|
652
|
-
knife(
|
650
|
+
it "knife download changes the role" do
|
651
|
+
knife("download /").should_succeed "Updated /roles/x.json\n"
|
652
|
+
knife("diff --name-status /").should_succeed ""
|
653
653
|
end
|
654
654
|
end
|
655
655
|
|
656
|
-
context
|
656
|
+
context "except the role file is textually different, but not ACTUALLY different" do
|
657
657
|
before do
|
658
|
-
file
|
658
|
+
file "roles/x.json", <<EOM
|
659
659
|
{
|
660
660
|
"chef_type": "role" ,
|
661
661
|
"default_attributes": {
|
@@ -674,29 +674,29 @@ EOM
|
|
674
674
|
EOM
|
675
675
|
end
|
676
676
|
|
677
|
-
it
|
678
|
-
knife(
|
679
|
-
knife(
|
677
|
+
it "knife download / does not change anything" do
|
678
|
+
knife("download /").should_succeed ""
|
679
|
+
knife("diff --name-status /").should_succeed ""
|
680
680
|
end
|
681
681
|
end
|
682
682
|
|
683
|
-
context
|
683
|
+
context "as well as one extra copy of each thing" do
|
684
684
|
before do
|
685
|
-
file
|
686
|
-
file
|
687
|
-
file
|
688
|
-
file
|
689
|
-
file
|
690
|
-
file
|
691
|
-
file
|
692
|
-
file
|
693
|
-
file
|
694
|
-
file
|
685
|
+
file "clients/y.json", { "public_key" => ChefZero::PUBLIC_KEY }
|
686
|
+
file "cookbooks/x-1.0.0/blah.rb", ""
|
687
|
+
file "cookbooks/x-2.0.0/metadata.rb", 'version "2.0.0"'
|
688
|
+
file "cookbooks/y-1.0.0/metadata.rb", 'version "1.0.0"'
|
689
|
+
file "data_bags/x/z.json", {}
|
690
|
+
file "data_bags/y/zz.json", {}
|
691
|
+
file "environments/y.json", {}
|
692
|
+
file "nodes/y.json", {}
|
693
|
+
file "roles/y.json", {}
|
694
|
+
file "users/y.json", { "public_key" => ChefZero::PUBLIC_KEY }
|
695
695
|
end
|
696
696
|
|
697
|
-
it
|
698
|
-
knife(
|
699
|
-
knife(
|
697
|
+
it "knife download does nothing" do
|
698
|
+
knife("download /").should_succeed ""
|
699
|
+
knife("diff --name-status /").should_succeed <<EOM
|
700
700
|
A\t/clients/y.json
|
701
701
|
A\t/cookbooks/x-1.0.0/blah.rb
|
702
702
|
A\t/cookbooks/x-2.0.0
|
@@ -710,8 +710,8 @@ A\t/users/y.json
|
|
710
710
|
EOM
|
711
711
|
end
|
712
712
|
|
713
|
-
it
|
714
|
-
knife(
|
713
|
+
it "knife download --purge deletes the extra files" do
|
714
|
+
knife("download --purge /").should_succeed <<EOM
|
715
715
|
Deleted extra entry /clients/y.json (purge is on)
|
716
716
|
Deleted extra entry /cookbooks/x-1.0.0/blah.rb (purge is on)
|
717
717
|
Deleted extra entry /cookbooks/x-2.0.0 (purge is on)
|
@@ -723,14 +723,14 @@ Deleted extra entry /nodes/y.json (purge is on)
|
|
723
723
|
Deleted extra entry /roles/y.json (purge is on)
|
724
724
|
Deleted extra entry /users/y.json (purge is on)
|
725
725
|
EOM
|
726
|
-
knife(
|
726
|
+
knife("diff --name-status /").should_succeed ""
|
727
727
|
end
|
728
728
|
end
|
729
729
|
end
|
730
730
|
|
731
|
-
when_the_repository
|
732
|
-
it
|
733
|
-
knife(
|
731
|
+
when_the_repository "is empty" do
|
732
|
+
it "knife download creates the extra files" do
|
733
|
+
knife("download /").should_succeed <<EOM
|
734
734
|
Created /clients
|
735
735
|
Created /clients/chef-validator.json
|
736
736
|
Created /clients/chef-webui.json
|
@@ -752,324 +752,324 @@ Created /users
|
|
752
752
|
Created /users/admin.json
|
753
753
|
Created /users/x.json
|
754
754
|
EOM
|
755
|
-
knife(
|
755
|
+
knife("diff --name-status /").should_succeed ""
|
756
756
|
end
|
757
757
|
|
758
|
-
context
|
758
|
+
context "when current directory is top level" do
|
759
759
|
before do
|
760
|
-
cwd
|
760
|
+
cwd "."
|
761
761
|
end
|
762
|
-
it
|
763
|
-
knife(
|
762
|
+
it "knife download with no parameters reports an error" do
|
763
|
+
knife("download").should_fail "FATAL: Must specify at least one argument. If you want to download everything in this directory, type \"knife download .\"\n", :stdout => /USAGE/
|
764
764
|
end
|
765
765
|
end
|
766
766
|
end
|
767
767
|
end
|
768
768
|
|
769
769
|
# Test download of an item when the other end doesn't even have the container
|
770
|
-
when_the_repository
|
771
|
-
when_the_chef_server
|
770
|
+
when_the_repository "is empty" do
|
771
|
+
when_the_chef_server "has two data bag items" do
|
772
772
|
before do
|
773
|
-
data_bag
|
773
|
+
data_bag "x", { "y" => {}, "z" => {} }
|
774
774
|
end
|
775
775
|
|
776
|
-
it
|
777
|
-
knife(
|
776
|
+
it "knife download of one data bag item itself succeeds" do
|
777
|
+
knife("download /data_bags/x/y.json").should_succeed <<EOM
|
778
778
|
Created /data_bags
|
779
779
|
Created /data_bags/x
|
780
780
|
Created /data_bags/x/y.json
|
781
781
|
EOM
|
782
|
-
knife(
|
782
|
+
knife("diff --name-status /data_bags").should_succeed <<EOM
|
783
783
|
D\t/data_bags/x/z.json
|
784
784
|
EOM
|
785
785
|
end
|
786
786
|
end
|
787
787
|
end
|
788
788
|
|
789
|
-
when_the_repository
|
789
|
+
when_the_repository "has three data bag items" do
|
790
790
|
before do
|
791
|
-
file
|
791
|
+
file "data_bags/x/deleted.json", <<EOM
|
792
792
|
{
|
793
793
|
"id": "deleted"
|
794
794
|
}
|
795
795
|
EOM
|
796
|
-
file
|
796
|
+
file "data_bags/x/modified.json", <<EOM
|
797
797
|
{
|
798
798
|
"id": "modified"
|
799
799
|
}
|
800
800
|
EOM
|
801
|
-
file
|
801
|
+
file "data_bags/x/unmodified.json", <<EOM
|
802
802
|
{
|
803
803
|
"id": "unmodified"
|
804
804
|
}
|
805
805
|
EOM
|
806
806
|
end
|
807
807
|
|
808
|
-
when_the_chef_server
|
808
|
+
when_the_chef_server "has a modified, unmodified, added and deleted data bag item" do
|
809
809
|
before do
|
810
|
-
data_bag
|
811
|
-
|
812
|
-
|
813
|
-
|
810
|
+
data_bag "x", {
|
811
|
+
"added" => {},
|
812
|
+
"modified" => { "foo" => "bar" },
|
813
|
+
"unmodified" => {},
|
814
814
|
}
|
815
815
|
end
|
816
816
|
|
817
|
-
it
|
818
|
-
knife(
|
817
|
+
it "knife download of the modified file succeeds" do
|
818
|
+
knife("download /data_bags/x/modified.json").should_succeed <<EOM
|
819
819
|
Updated /data_bags/x/modified.json
|
820
820
|
EOM
|
821
|
-
knife(
|
821
|
+
knife("diff --name-status /data_bags").should_succeed <<EOM
|
822
822
|
D\t/data_bags/x/added.json
|
823
823
|
A\t/data_bags/x/deleted.json
|
824
824
|
EOM
|
825
825
|
end
|
826
|
-
it
|
827
|
-
knife(
|
828
|
-
knife(
|
826
|
+
it "knife download of the unmodified file does nothing" do
|
827
|
+
knife("download /data_bags/x/unmodified.json").should_succeed ""
|
828
|
+
knife("diff --name-status /data_bags").should_succeed <<EOM
|
829
829
|
D\t/data_bags/x/added.json
|
830
830
|
M\t/data_bags/x/modified.json
|
831
831
|
A\t/data_bags/x/deleted.json
|
832
832
|
EOM
|
833
833
|
end
|
834
|
-
it
|
835
|
-
knife(
|
834
|
+
it "knife download of the added file succeeds" do
|
835
|
+
knife("download /data_bags/x/added.json").should_succeed <<EOM
|
836
836
|
Created /data_bags/x/added.json
|
837
837
|
EOM
|
838
|
-
knife(
|
838
|
+
knife("diff --name-status /data_bags").should_succeed <<EOM
|
839
839
|
M\t/data_bags/x/modified.json
|
840
840
|
A\t/data_bags/x/deleted.json
|
841
841
|
EOM
|
842
842
|
end
|
843
|
-
it
|
844
|
-
knife(
|
845
|
-
knife(
|
843
|
+
it "knife download of the deleted file does nothing" do
|
844
|
+
knife("download /data_bags/x/deleted.json").should_succeed ""
|
845
|
+
knife("diff --name-status /data_bags").should_succeed <<EOM
|
846
846
|
D\t/data_bags/x/added.json
|
847
847
|
M\t/data_bags/x/modified.json
|
848
848
|
A\t/data_bags/x/deleted.json
|
849
849
|
EOM
|
850
850
|
end
|
851
|
-
it
|
852
|
-
knife(
|
851
|
+
it "knife download --purge of the deleted file deletes it" do
|
852
|
+
knife("download --purge /data_bags/x/deleted.json").should_succeed <<EOM
|
853
853
|
Deleted extra entry /data_bags/x/deleted.json (purge is on)
|
854
854
|
EOM
|
855
|
-
knife(
|
855
|
+
knife("diff --name-status /data_bags").should_succeed <<EOM
|
856
856
|
D\t/data_bags/x/added.json
|
857
857
|
M\t/data_bags/x/modified.json
|
858
858
|
EOM
|
859
859
|
end
|
860
|
-
it
|
861
|
-
knife(
|
860
|
+
it "knife download of the entire data bag downloads everything" do
|
861
|
+
knife("download /data_bags/x").should_succeed <<EOM
|
862
862
|
Created /data_bags/x/added.json
|
863
863
|
Updated /data_bags/x/modified.json
|
864
864
|
EOM
|
865
|
-
knife(
|
865
|
+
knife("diff --name-status /data_bags").should_succeed <<EOM
|
866
866
|
A\t/data_bags/x/deleted.json
|
867
867
|
EOM
|
868
868
|
end
|
869
|
-
it
|
870
|
-
knife(
|
869
|
+
it "knife download --purge of the entire data bag downloads everything" do
|
870
|
+
knife("download --purge /data_bags/x").should_succeed <<EOM
|
871
871
|
Created /data_bags/x/added.json
|
872
872
|
Updated /data_bags/x/modified.json
|
873
873
|
Deleted extra entry /data_bags/x/deleted.json (purge is on)
|
874
874
|
EOM
|
875
|
-
knife(
|
875
|
+
knife("diff --name-status /data_bags").should_succeed ""
|
876
876
|
end
|
877
|
-
context
|
877
|
+
context "when cwd is the /data_bags directory" do
|
878
878
|
before do
|
879
|
-
cwd
|
879
|
+
cwd "data_bags"
|
880
880
|
end
|
881
|
-
it
|
882
|
-
knife(
|
881
|
+
it "knife download fails" do
|
882
|
+
knife("download").should_fail "FATAL: Must specify at least one argument. If you want to download everything in this directory, type \"knife download .\"\n", :stdout => /USAGE/
|
883
883
|
end
|
884
|
-
it
|
885
|
-
knife(
|
884
|
+
it "knife download --purge . downloads everything" do
|
885
|
+
knife("download --purge .").should_succeed <<EOM
|
886
886
|
Created x/added.json
|
887
887
|
Updated x/modified.json
|
888
888
|
Deleted extra entry x/deleted.json (purge is on)
|
889
889
|
EOM
|
890
|
-
knife(
|
890
|
+
knife("diff --name-status /data_bags").should_succeed ""
|
891
891
|
end
|
892
|
-
it
|
893
|
-
knife(
|
892
|
+
it "knife download --purge * downloads everything" do
|
893
|
+
knife("download --purge *").should_succeed <<EOM
|
894
894
|
Created x/added.json
|
895
895
|
Updated x/modified.json
|
896
896
|
Deleted extra entry x/deleted.json (purge is on)
|
897
897
|
EOM
|
898
|
-
knife(
|
898
|
+
knife("diff --name-status /data_bags").should_succeed ""
|
899
899
|
end
|
900
900
|
end
|
901
901
|
end
|
902
902
|
end
|
903
903
|
|
904
|
-
when_the_repository
|
904
|
+
when_the_repository "has a cookbook" do
|
905
905
|
before do
|
906
|
-
file
|
907
|
-
file
|
906
|
+
file "cookbooks/x-1.0.0/metadata.rb", 'name "x"; version "1.0.0"#unmodified'
|
907
|
+
file "cookbooks/x-1.0.0/z.rb", ""
|
908
908
|
end
|
909
909
|
|
910
|
-
when_the_chef_server
|
910
|
+
when_the_chef_server "has a modified, added and deleted file for the cookbook" do
|
911
911
|
before do
|
912
|
-
cookbook
|
912
|
+
cookbook "x", "1.0.0", { "y.rb" => "hi" }
|
913
913
|
end
|
914
914
|
|
915
|
-
it
|
916
|
-
knife(
|
917
|
-
knife(
|
915
|
+
it "knife download of a modified file succeeds" do
|
916
|
+
knife("download /cookbooks/x-1.0.0/metadata.rb").should_succeed "Updated /cookbooks/x-1.0.0/metadata.rb\n"
|
917
|
+
knife("diff --name-status /cookbooks").should_succeed <<EOM
|
918
918
|
D\t/cookbooks/x-1.0.0/y.rb
|
919
919
|
A\t/cookbooks/x-1.0.0/z.rb
|
920
920
|
EOM
|
921
921
|
end
|
922
|
-
it
|
923
|
-
knife(
|
924
|
-
knife(
|
922
|
+
it "knife download of a deleted file does nothing" do
|
923
|
+
knife("download /cookbooks/x-1.0.0/z.rb").should_succeed ""
|
924
|
+
knife("diff --name-status /cookbooks").should_succeed <<EOM
|
925
925
|
M\t/cookbooks/x-1.0.0/metadata.rb
|
926
926
|
D\t/cookbooks/x-1.0.0/y.rb
|
927
927
|
A\t/cookbooks/x-1.0.0/z.rb
|
928
928
|
EOM
|
929
929
|
end
|
930
|
-
it
|
931
|
-
knife(
|
932
|
-
knife(
|
930
|
+
it "knife download --purge of a deleted file succeeds" do
|
931
|
+
knife("download --purge /cookbooks/x-1.0.0/z.rb").should_succeed "Deleted extra entry /cookbooks/x-1.0.0/z.rb (purge is on)\n"
|
932
|
+
knife("diff --name-status /cookbooks").should_succeed <<EOM
|
933
933
|
M\t/cookbooks/x-1.0.0/metadata.rb
|
934
934
|
D\t/cookbooks/x-1.0.0/y.rb
|
935
935
|
EOM
|
936
936
|
end
|
937
|
-
it
|
938
|
-
knife(
|
939
|
-
knife(
|
937
|
+
it "knife download of an added file succeeds" do
|
938
|
+
knife("download /cookbooks/x-1.0.0/y.rb").should_succeed "Created /cookbooks/x-1.0.0/y.rb\n"
|
939
|
+
knife("diff --name-status /cookbooks").should_succeed <<EOM
|
940
940
|
M\t/cookbooks/x-1.0.0/metadata.rb
|
941
941
|
A\t/cookbooks/x-1.0.0/z.rb
|
942
942
|
EOM
|
943
943
|
end
|
944
|
-
it
|
945
|
-
knife(
|
944
|
+
it "knife download of the cookbook itself succeeds" do
|
945
|
+
knife("download /cookbooks/x-1.0.0").should_succeed <<EOM
|
946
946
|
Updated /cookbooks/x-1.0.0/metadata.rb
|
947
947
|
Created /cookbooks/x-1.0.0/y.rb
|
948
948
|
EOM
|
949
|
-
knife(
|
949
|
+
knife("diff --name-status /cookbooks").should_succeed <<EOM
|
950
950
|
A\t/cookbooks/x-1.0.0/z.rb
|
951
951
|
EOM
|
952
952
|
end
|
953
|
-
it
|
954
|
-
knife(
|
953
|
+
it "knife download --purge of the cookbook itself succeeds" do
|
954
|
+
knife("download --purge /cookbooks/x-1.0.0").should_succeed <<EOM
|
955
955
|
Updated /cookbooks/x-1.0.0/metadata.rb
|
956
956
|
Created /cookbooks/x-1.0.0/y.rb
|
957
957
|
Deleted extra entry /cookbooks/x-1.0.0/z.rb (purge is on)
|
958
958
|
EOM
|
959
|
-
knife(
|
959
|
+
knife("diff --name-status /cookbooks").should_succeed ""
|
960
960
|
end
|
961
961
|
end
|
962
962
|
end
|
963
963
|
|
964
|
-
when_the_repository
|
964
|
+
when_the_repository "has a cookbook" do
|
965
965
|
before do
|
966
|
-
file
|
967
|
-
file
|
966
|
+
file "cookbooks/x-1.0.0/metadata.rb", cb_metadata("x", "1.0.0")
|
967
|
+
file "cookbooks/x-1.0.0/onlyin1.0.0.rb", "old_text"
|
968
968
|
end
|
969
969
|
|
970
|
-
when_the_chef_server
|
970
|
+
when_the_chef_server "has a later version for the cookbook" do
|
971
971
|
before do
|
972
|
-
cookbook
|
973
|
-
cookbook
|
972
|
+
cookbook "x", "1.0.0", { "onlyin1.0.0.rb" => "" }
|
973
|
+
cookbook "x", "1.0.1", { "onlyin1.0.1.rb" => "hi" }
|
974
974
|
end
|
975
975
|
|
976
|
-
it
|
977
|
-
knife(
|
976
|
+
it "knife download /cookbooks/x downloads the latest version" do
|
977
|
+
knife("download --purge /cookbooks").should_succeed <<EOM
|
978
978
|
Updated /cookbooks/x-1.0.0/onlyin1.0.0.rb
|
979
979
|
Created /cookbooks/x-1.0.1
|
980
980
|
Created /cookbooks/x-1.0.1/metadata.rb
|
981
981
|
Created /cookbooks/x-1.0.1/onlyin1.0.1.rb
|
982
982
|
EOM
|
983
|
-
knife(
|
983
|
+
knife("diff --name-status /cookbooks").should_succeed ""
|
984
984
|
end
|
985
985
|
end
|
986
986
|
|
987
|
-
when_the_chef_server
|
987
|
+
when_the_chef_server "has an earlier version for the cookbook" do
|
988
988
|
before do
|
989
|
-
cookbook
|
990
|
-
cookbook
|
989
|
+
cookbook "x", "1.0.0", { "onlyin1.0.0.rb" => "" }
|
990
|
+
cookbook "x", "0.9.9", { "onlyin0.9.9.rb" => "hi" }
|
991
991
|
end
|
992
992
|
|
993
|
-
it
|
994
|
-
knife(
|
993
|
+
it "knife download /cookbooks downloads the updated file" do
|
994
|
+
knife("download --purge /cookbooks").should_succeed <<EOM
|
995
995
|
Created /cookbooks/x-0.9.9
|
996
996
|
Created /cookbooks/x-0.9.9/metadata.rb
|
997
997
|
Created /cookbooks/x-0.9.9/onlyin0.9.9.rb
|
998
998
|
Updated /cookbooks/x-1.0.0/onlyin1.0.0.rb
|
999
999
|
EOM
|
1000
|
-
knife(
|
1000
|
+
knife("diff --name-status /cookbooks").should_succeed ""
|
1001
1001
|
end
|
1002
1002
|
end
|
1003
1003
|
|
1004
|
-
when_the_chef_server
|
1004
|
+
when_the_chef_server "has a later version for the cookbook, and no current version" do
|
1005
1005
|
before do
|
1006
|
-
cookbook
|
1006
|
+
cookbook "x", "1.0.1", { "onlyin1.0.1.rb" => "hi" }
|
1007
1007
|
end
|
1008
1008
|
|
1009
|
-
it
|
1010
|
-
knife(
|
1009
|
+
it "knife download /cookbooks/x downloads the latest version" do
|
1010
|
+
knife("download --purge /cookbooks").should_succeed <<EOM
|
1011
1011
|
Created /cookbooks/x-1.0.1
|
1012
1012
|
Created /cookbooks/x-1.0.1/metadata.rb
|
1013
1013
|
Created /cookbooks/x-1.0.1/onlyin1.0.1.rb
|
1014
1014
|
Deleted extra entry /cookbooks/x-1.0.0 (purge is on)
|
1015
1015
|
EOM
|
1016
|
-
knife(
|
1016
|
+
knife("diff --name-status /cookbooks").should_succeed ""
|
1017
1017
|
end
|
1018
1018
|
end
|
1019
1019
|
|
1020
|
-
when_the_chef_server
|
1020
|
+
when_the_chef_server "has an earlier version for the cookbook, and no current version" do
|
1021
1021
|
before do
|
1022
|
-
cookbook
|
1022
|
+
cookbook "x", "0.9.9", { "onlyin0.9.9.rb" => "hi" }
|
1023
1023
|
end
|
1024
1024
|
|
1025
|
-
it
|
1026
|
-
knife(
|
1025
|
+
it "knife download --purge /cookbooks downloads the old version and deletes the new version" do
|
1026
|
+
knife("download --purge /cookbooks").should_succeed <<EOM
|
1027
1027
|
Created /cookbooks/x-0.9.9
|
1028
1028
|
Created /cookbooks/x-0.9.9/metadata.rb
|
1029
1029
|
Created /cookbooks/x-0.9.9/onlyin0.9.9.rb
|
1030
1030
|
Deleted extra entry /cookbooks/x-1.0.0 (purge is on)
|
1031
1031
|
EOM
|
1032
|
-
knife(
|
1032
|
+
knife("diff --name-status /cookbooks").should_succeed ""
|
1033
1033
|
end
|
1034
1034
|
end
|
1035
1035
|
end
|
1036
1036
|
|
1037
|
-
when_the_chef_server
|
1037
|
+
when_the_chef_server "has an environment" do
|
1038
1038
|
before do
|
1039
|
-
environment
|
1039
|
+
environment "x", {}
|
1040
1040
|
end
|
1041
1041
|
|
1042
|
-
when_the_repository
|
1042
|
+
when_the_repository "has the same environment with the wrong name in the file" do
|
1043
1043
|
before do
|
1044
|
-
file
|
1044
|
+
file "environments/x.json", { "name" => "y" }
|
1045
1045
|
end
|
1046
1046
|
|
1047
|
-
it
|
1048
|
-
knife(
|
1049
|
-
knife(
|
1047
|
+
it "knife download succeeds" do
|
1048
|
+
knife("download /environments/x.json").should_succeed "Updated /environments/x.json\n"
|
1049
|
+
knife("diff --name-status /environments/x.json").should_succeed ""
|
1050
1050
|
end
|
1051
1051
|
end
|
1052
1052
|
|
1053
|
-
when_the_repository
|
1053
|
+
when_the_repository "has the same environment with no name in the file" do
|
1054
1054
|
before do
|
1055
|
-
file
|
1055
|
+
file "environments/x.json", { "description" => "hi" }
|
1056
1056
|
end
|
1057
1057
|
|
1058
|
-
it
|
1059
|
-
knife(
|
1060
|
-
knife(
|
1058
|
+
it "knife download succeeds" do
|
1059
|
+
knife("download /environments/x.json").should_succeed "Updated /environments/x.json\n"
|
1060
|
+
knife("diff --name-status /environments/x.json").should_succeed ""
|
1061
1061
|
end
|
1062
1062
|
end
|
1063
1063
|
end
|
1064
1064
|
end # with versioned cookbooks
|
1065
1065
|
|
1066
|
-
when_the_chef_server
|
1066
|
+
when_the_chef_server "has a cookbook" do
|
1067
1067
|
before do
|
1068
|
-
cookbook
|
1068
|
+
cookbook "x", "1.0.0"
|
1069
1069
|
end
|
1070
1070
|
|
1071
|
-
when_the_repository
|
1072
|
-
it
|
1071
|
+
when_the_repository "is empty" do
|
1072
|
+
it "knife download /cookbooks/x signs all requests" do
|
1073
1073
|
|
1074
1074
|
# Check that BasicClient.request() always gets called with X-OPS-USERID
|
1075
1075
|
original_new = Chef::HTTP::BasicClient.method(:new)
|
@@ -1077,13 +1077,13 @@ EOM
|
|
1077
1077
|
new_result = original_new.call(*args)
|
1078
1078
|
original_request = new_result.method(:request)
|
1079
1079
|
expect(new_result).to receive(:request) { |method, url, body, headers, &response_handler|
|
1080
|
-
expect(headers[
|
1080
|
+
expect(headers["X-OPS-USERID"]).not_to be_nil
|
1081
1081
|
original_request.call(method, url, body, headers, &response_handler)
|
1082
1082
|
}.at_least(:once)
|
1083
1083
|
new_result
|
1084
1084
|
}.at_least(:once)
|
1085
1085
|
|
1086
|
-
knife(
|
1086
|
+
knife("download /cookbooks/x").should_succeed <<EOM
|
1087
1087
|
Created /cookbooks
|
1088
1088
|
Created /cookbooks/x
|
1089
1089
|
Created /cookbooks/x/metadata.rb
|
@@ -1094,28 +1094,19 @@ EOM
|
|
1094
1094
|
|
1095
1095
|
when_the_chef_server "is in Enterprise mode", :osc_compat => false, :single_org => false do
|
1096
1096
|
before do
|
1097
|
-
|
1098
|
-
|
1099
|
-
|
1100
|
-
|
1097
|
+
user "foo", {}
|
1098
|
+
user "bar", {}
|
1099
|
+
user "foobar", {}
|
1100
|
+
organization "foo", { "full_name" => "Something" }
|
1101
1101
|
end
|
1102
1102
|
|
1103
1103
|
before :each do
|
1104
|
-
Chef::Config.chef_server_url = URI.join(Chef::Config.chef_server_url,
|
1105
|
-
end
|
1106
|
-
when_the_repository 'has existing top level files' do
|
1107
|
-
before do
|
1108
|
-
file 'invitations.json', {}
|
1109
|
-
end
|
1110
|
-
|
1111
|
-
it "can still download top level files" do
|
1112
|
-
knife('download /invitations.json').should_succeed
|
1113
|
-
end
|
1104
|
+
Chef::Config.chef_server_url = URI.join(Chef::Config.chef_server_url, "/organizations/foo")
|
1114
1105
|
end
|
1115
1106
|
|
1116
|
-
when_the_repository
|
1117
|
-
|
1118
|
-
knife(
|
1107
|
+
when_the_repository "has all the default stuff" do
|
1108
|
+
before do
|
1109
|
+
knife("download /").should_succeed <<EOM
|
1119
1110
|
Created /acls
|
1120
1111
|
Created /acls/clients
|
1121
1112
|
Created /acls/clients/foo-validator.json
|
@@ -1129,9 +1120,10 @@ Created /acls/containers/environments.json
|
|
1129
1120
|
Created /acls/containers/groups.json
|
1130
1121
|
Created /acls/containers/nodes.json
|
1131
1122
|
Created /acls/containers/policies.json
|
1123
|
+
Created /acls/containers/policy_groups.json
|
1132
1124
|
Created /acls/containers/roles.json
|
1133
1125
|
Created /acls/containers/sandboxes.json
|
1134
|
-
Created /acls/
|
1126
|
+
Created /acls/cookbook_artifacts
|
1135
1127
|
Created /acls/cookbooks
|
1136
1128
|
Created /acls/data_bags
|
1137
1129
|
Created /acls/environments
|
@@ -1141,8 +1133,9 @@ Created /acls/groups/admins.json
|
|
1141
1133
|
Created /acls/groups/billing-admins.json
|
1142
1134
|
Created /acls/groups/clients.json
|
1143
1135
|
Created /acls/groups/users.json
|
1144
|
-
Created /acls/groups/x.json
|
1145
1136
|
Created /acls/nodes
|
1137
|
+
Created /acls/policies
|
1138
|
+
Created /acls/policy_groups
|
1146
1139
|
Created /acls/roles
|
1147
1140
|
Created /acls/organization.json
|
1148
1141
|
Created /clients
|
@@ -1157,9 +1150,10 @@ Created /containers/environments.json
|
|
1157
1150
|
Created /containers/groups.json
|
1158
1151
|
Created /containers/nodes.json
|
1159
1152
|
Created /containers/policies.json
|
1153
|
+
Created /containers/policy_groups.json
|
1160
1154
|
Created /containers/roles.json
|
1161
1155
|
Created /containers/sandboxes.json
|
1162
|
-
Created /
|
1156
|
+
Created /cookbook_artifacts
|
1163
1157
|
Created /cookbooks
|
1164
1158
|
Created /data_bags
|
1165
1159
|
Created /environments
|
@@ -1169,14 +1163,151 @@ Created /groups/admins.json
|
|
1169
1163
|
Created /groups/billing-admins.json
|
1170
1164
|
Created /groups/clients.json
|
1171
1165
|
Created /groups/users.json
|
1172
|
-
Created /groups/x.json
|
1173
1166
|
Created /invitations.json
|
1174
1167
|
Created /members.json
|
1175
1168
|
Created /nodes
|
1176
1169
|
Created /org.json
|
1170
|
+
Created /policies
|
1171
|
+
Created /policy_groups
|
1177
1172
|
Created /roles
|
1178
1173
|
EOM
|
1179
|
-
|
1174
|
+
end
|
1175
|
+
|
1176
|
+
context "and the server has one of each thing" do
|
1177
|
+
before do
|
1178
|
+
# acl_for %w(organizations foo groups blah)
|
1179
|
+
client "x", {}
|
1180
|
+
cookbook "x", "1.0.0"
|
1181
|
+
cookbook_artifact "x", "1x1", { "metadata.rb" => cb_metadata("x", "1.0.0") }
|
1182
|
+
container "x", {}
|
1183
|
+
data_bag "x", { "y" => {} }
|
1184
|
+
environment "x", {}
|
1185
|
+
group "x", {}
|
1186
|
+
org_invite "foo"
|
1187
|
+
org_member "bar"
|
1188
|
+
node "x", {}
|
1189
|
+
policy "x", "1.0.0", {}
|
1190
|
+
policy "blah", "1.0.0", {}
|
1191
|
+
policy_group "x", {
|
1192
|
+
"policies" => {
|
1193
|
+
"x" => { "revision_id" => "1.0.0" },
|
1194
|
+
"blah" => { "revision_id" => "1.0.0" },
|
1195
|
+
}
|
1196
|
+
}
|
1197
|
+
role "x", {}
|
1198
|
+
end
|
1199
|
+
|
1200
|
+
before do
|
1201
|
+
knife("download /acls /groups/clients.json /groups/users.json").should_succeed <<-EOM
|
1202
|
+
Created /acls/clients/x.json
|
1203
|
+
Created /acls/containers/x.json
|
1204
|
+
Created /acls/cookbook_artifacts/x.json
|
1205
|
+
Created /acls/cookbooks/x.json
|
1206
|
+
Created /acls/data_bags/x.json
|
1207
|
+
Created /acls/environments/x.json
|
1208
|
+
Created /acls/groups/x.json
|
1209
|
+
Created /acls/nodes/x.json
|
1210
|
+
Created /acls/policies/blah.json
|
1211
|
+
Created /acls/policies/x.json
|
1212
|
+
Created /acls/policy_groups/x.json
|
1213
|
+
Created /acls/roles/x.json
|
1214
|
+
Updated /groups/clients.json
|
1215
|
+
Updated /groups/users.json
|
1216
|
+
EOM
|
1217
|
+
end
|
1218
|
+
|
1219
|
+
it "knife download / downloads everything" do
|
1220
|
+
knife("download /").should_succeed <<EOM
|
1221
|
+
Created /clients/x.json
|
1222
|
+
Created /containers/x.json
|
1223
|
+
Created /cookbook_artifacts/x-1x1
|
1224
|
+
Created /cookbook_artifacts/x-1x1/metadata.rb
|
1225
|
+
Created /cookbooks/x
|
1226
|
+
Created /cookbooks/x/metadata.rb
|
1227
|
+
Created /data_bags/x
|
1228
|
+
Created /data_bags/x/y.json
|
1229
|
+
Created /environments/x.json
|
1230
|
+
Created /groups/x.json
|
1231
|
+
Updated /invitations.json
|
1232
|
+
Updated /members.json
|
1233
|
+
Created /nodes/x.json
|
1234
|
+
Created /policies/blah-1.0.0.json
|
1235
|
+
Created /policies/x-1.0.0.json
|
1236
|
+
Created /policy_groups/x.json
|
1237
|
+
Created /roles/x.json
|
1238
|
+
EOM
|
1239
|
+
knife("diff --name-status /").should_succeed ""
|
1240
|
+
end
|
1241
|
+
|
1242
|
+
context "and the repository has an identical copy of each thing" do
|
1243
|
+
before do
|
1244
|
+
# TODO We have to upload acls for an existing group due to a lack of
|
1245
|
+
# dependency detection during upload. Fix that!
|
1246
|
+
file "clients/x.json", { "public_key" => ChefZero::PUBLIC_KEY }
|
1247
|
+
file "containers/x.json", {}
|
1248
|
+
file "cookbooks/x/metadata.rb", cb_metadata("x", "1.0.0")
|
1249
|
+
file "cookbook_artifacts/x-1x1/metadata.rb", cb_metadata("x", "1.0.0")
|
1250
|
+
file "data_bags/x/y.json", {}
|
1251
|
+
file "environments/x.json", {}
|
1252
|
+
file "groups/x.json", {}
|
1253
|
+
file "invitations.json", [ "foo" ]
|
1254
|
+
file "members.json", [ "bar" ]
|
1255
|
+
file "nodes/x.json", {}
|
1256
|
+
file "org.json", { "full_name" => "Something" }
|
1257
|
+
file "policies/x-1.0.0.json", {}
|
1258
|
+
file "policies/blah-1.0.0.json", {}
|
1259
|
+
file "policy_groups/x.json", { "policies" => { "x" => { "revision_id" => "1.0.0" }, "blah" => { "revision_id" => "1.0.0" } } }
|
1260
|
+
file "roles/x.json", {}
|
1261
|
+
end
|
1262
|
+
|
1263
|
+
it "knife download makes no changes" do
|
1264
|
+
knife("download /").should_succeed ""
|
1265
|
+
end
|
1266
|
+
end
|
1267
|
+
|
1268
|
+
context "and the repository has a slightly different copy of each thing" do
|
1269
|
+
before do
|
1270
|
+
# acl_for %w(organizations foo groups blah)
|
1271
|
+
file "clients/x.json", { "validator" => true }
|
1272
|
+
file "containers/x.json", {}
|
1273
|
+
file "cookbooks/x/metadata.rb", cb_metadata("x", "1.0.1")
|
1274
|
+
file "cookbook_artifacts/x-1x1/metadata.rb", cb_metadata("x", "1.0.1")
|
1275
|
+
file "data_bags/x/y.json", { "a" => "b" }
|
1276
|
+
file "environments/x.json", { "description" => "foo" }
|
1277
|
+
file "groups/x.json", { "description" => "foo" }
|
1278
|
+
file "groups/x.json", { "groups" => [ "admin" ] }
|
1279
|
+
file "nodes/x.json", { "run_list" => [ "blah" ] }
|
1280
|
+
file "org.json", { "full_name" => "Something Else " }
|
1281
|
+
file "policies/x-1.0.0.json", { "run_list" => [ "blah" ] }
|
1282
|
+
file "policy_groups/x.json", {
|
1283
|
+
"policies" => {
|
1284
|
+
"x" => { "revision_id" => "1.0.1" },
|
1285
|
+
"y" => { "revision_id" => "1.0.0" },
|
1286
|
+
}
|
1287
|
+
}
|
1288
|
+
file "roles/x.json", { "run_list" => [ "blah" ] }
|
1289
|
+
end
|
1290
|
+
|
1291
|
+
it "knife download updates everything" do
|
1292
|
+
knife("download /").should_succeed <<EOM
|
1293
|
+
Updated /clients/x.json
|
1294
|
+
Updated /cookbook_artifacts/x-1x1/metadata.rb
|
1295
|
+
Updated /cookbooks/x/metadata.rb
|
1296
|
+
Updated /data_bags/x/y.json
|
1297
|
+
Updated /environments/x.json
|
1298
|
+
Updated /groups/x.json
|
1299
|
+
Updated /invitations.json
|
1300
|
+
Updated /members.json
|
1301
|
+
Updated /nodes/x.json
|
1302
|
+
Updated /org.json
|
1303
|
+
Created /policies/blah-1.0.0.json
|
1304
|
+
Updated /policies/x-1.0.0.json
|
1305
|
+
Updated /policy_groups/x.json
|
1306
|
+
Updated /roles/x.json
|
1307
|
+
EOM
|
1308
|
+
knife("diff --name-status /").should_succeed ""
|
1309
|
+
end
|
1310
|
+
end
|
1180
1311
|
end
|
1181
1312
|
end
|
1182
1313
|
end
|