chef 12.6.0 → 12.7.2
Sign up to get free protection for your applications and to get access to all the features.
- 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-shell +1 -1
- data/bin/chef-solo +4 -4
- 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/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:: Daniel DeLeo (<dan@
|
3
|
-
# Copyright:: Copyright
|
2
|
+
# Author:: Daniel DeLeo (<dan@chef.io>)
|
3
|
+
# Copyright:: Copyright 2012-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");
|
@@ -16,15 +16,15 @@
|
|
16
16
|
# limitations under the License.
|
17
17
|
#
|
18
18
|
|
19
|
-
require
|
19
|
+
require "spec_helper"
|
20
20
|
require "chef/node/immutable_collections"
|
21
21
|
|
22
22
|
describe Chef::Node::ImmutableMash do
|
23
23
|
before do
|
24
|
-
@data_in = {:top => {:second_level => "some value"},
|
25
|
-
|
26
|
-
|
27
|
-
|
24
|
+
@data_in = { :top => { :second_level => "some value" },
|
25
|
+
"top_level_2" => %w{array of values},
|
26
|
+
:top_level_3 => [{ :hash_array => 1, :hash_array_b => 2 }],
|
27
|
+
:top_level_4 => { :level2 => { :key => "value" } },
|
28
28
|
}
|
29
29
|
@immutable_mash = Chef::Node::ImmutableMash.new(@data_in)
|
30
30
|
end
|
@@ -34,7 +34,7 @@ describe Chef::Node::ImmutableMash do
|
|
34
34
|
end
|
35
35
|
|
36
36
|
it "element references like a regular Mash" do
|
37
|
-
expect(@immutable_mash[:top_level_2]).to eq(%w
|
37
|
+
expect(@immutable_mash[:top_level_2]).to eq(%w{array of values})
|
38
38
|
end
|
39
39
|
|
40
40
|
it "converts Hash-like inputs into ImmutableMash's" do
|
@@ -64,19 +64,19 @@ describe Chef::Node::ImmutableMash do
|
|
64
64
|
end
|
65
65
|
|
66
66
|
it "converts an immutable nested mash to a new mutable hash" do
|
67
|
-
expect(@copy[
|
67
|
+
expect(@copy["top_level_4"]["level2"]).to be_instance_of(Hash)
|
68
68
|
end
|
69
69
|
|
70
70
|
it "converts an immutable nested array to a new mutable array" do
|
71
|
-
expect(@copy[
|
71
|
+
expect(@copy["top_level_2"]).to be_instance_of(Array)
|
72
72
|
end
|
73
73
|
|
74
74
|
it "should create a mash with the same content" do
|
75
75
|
expect(@copy).to eq(@immutable_mash)
|
76
76
|
end
|
77
77
|
|
78
|
-
it
|
79
|
-
expect { @copy[
|
78
|
+
it "should allow mutation" do
|
79
|
+
expect { @copy["m"] = "m" }.not_to raise_error
|
80
80
|
end
|
81
81
|
|
82
82
|
end
|
@@ -94,7 +94,7 @@ describe Chef::Node::ImmutableMash do
|
|
94
94
|
:reject!,
|
95
95
|
:replace,
|
96
96
|
:select!,
|
97
|
-
:shift
|
97
|
+
:shift,
|
98
98
|
].each do |mutator|
|
99
99
|
it "doesn't allow mutation via `#{mutator}'" do
|
100
100
|
expect { @immutable_mash.send(mutator) }.to raise_error
|
@@ -112,9 +112,9 @@ end
|
|
112
112
|
describe Chef::Node::ImmutableArray do
|
113
113
|
|
114
114
|
before do
|
115
|
-
@immutable_array = Chef::Node::ImmutableArray.new(%w
|
116
|
-
immutable_mash = Chef::Node::ImmutableMash.new({:m =>
|
117
|
-
@immutable_nested_array = Chef::Node::ImmutableArray.new(["level1"
|
115
|
+
@immutable_array = Chef::Node::ImmutableArray.new(%w{foo bar baz} + Array(1..3) + [nil, true, false, [ "el", 0, nil ] ])
|
116
|
+
immutable_mash = Chef::Node::ImmutableMash.new({ :m => "m" })
|
117
|
+
@immutable_nested_array = Chef::Node::ImmutableArray.new(["level1", @immutable_array, immutable_mash])
|
118
118
|
end
|
119
119
|
|
120
120
|
##
|
@@ -151,10 +151,10 @@ describe Chef::Node::ImmutableArray do
|
|
151
151
|
:sort!,
|
152
152
|
:sort_by!,
|
153
153
|
:uniq!,
|
154
|
-
:unshift
|
154
|
+
:unshift,
|
155
155
|
].each do |mutator|
|
156
156
|
it "does not allow mutation via `#{mutator}" do
|
157
|
-
expect { @immutable_array.send(mutator)}.to raise_error
|
157
|
+
expect { @immutable_array.send(mutator) }.to raise_error
|
158
158
|
end
|
159
159
|
end
|
160
160
|
|
@@ -189,10 +189,9 @@ describe Chef::Node::ImmutableArray do
|
|
189
189
|
expect(@copy).to eq(@immutable_nested_array)
|
190
190
|
end
|
191
191
|
|
192
|
-
it
|
193
|
-
expect { @copy <<
|
192
|
+
it "should allow mutation" do
|
193
|
+
expect { @copy << "m" }.not_to raise_error
|
194
194
|
end
|
195
195
|
end
|
196
196
|
|
197
197
|
end
|
198
|
-
|
data/spec/unit/node_map_spec.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
#
|
2
2
|
# Author:: Lamont Granquist (<lamont@chef.io>)
|
3
|
-
# Copyright:: Copyright
|
3
|
+
# Copyright:: Copyright 2014-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");
|
@@ -16,8 +16,8 @@
|
|
16
16
|
# limitations under the License.
|
17
17
|
#
|
18
18
|
|
19
|
-
require
|
20
|
-
require
|
19
|
+
require "spec_helper"
|
20
|
+
require "chef/node_map"
|
21
21
|
|
22
22
|
describe Chef::NodeMap do
|
23
23
|
|
@@ -27,7 +27,7 @@ describe Chef::NodeMap do
|
|
27
27
|
|
28
28
|
describe "with a bad filter name" do
|
29
29
|
it "should raise an error" do
|
30
|
-
expect{ node_map.set(node, :thing, on_platform_family:
|
30
|
+
expect { node_map.set(node, :thing, on_platform_family: "rhel") }.to raise_error
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
@@ -156,7 +156,7 @@ describe Chef::NodeMap do
|
|
156
156
|
expect(node_map.get(node, :chef_gem)).to eql(:foo)
|
157
157
|
end
|
158
158
|
it "should handle :on_platforms => [ 'windows' ]" do
|
159
|
-
node_map.set(:dsc_script, :foo, :on_platforms => [
|
159
|
+
node_map.set(:dsc_script, :foo, :on_platforms => [ "windows" ])
|
160
160
|
allow(node).to receive(:[]).with(:platform).and_return("windows")
|
161
161
|
expect(node_map.get(node, :dsc_script)).to eql(:foo)
|
162
162
|
end
|
data/spec/unit/node_spec.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
#
|
2
|
-
# Author:: Adam Jacob (<adam@
|
3
|
-
# Copyright:: Copyright
|
2
|
+
# Author:: Adam Jacob (<adam@chef.io>)
|
3
|
+
# Copyright:: Copyright 2008-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");
|
@@ -16,8 +16,8 @@
|
|
16
16
|
# limitations under the License.
|
17
17
|
#
|
18
18
|
|
19
|
-
require
|
20
|
-
require
|
19
|
+
require "spec_helper"
|
20
|
+
require "ostruct"
|
21
21
|
|
22
22
|
describe Chef::Node do
|
23
23
|
|
@@ -27,32 +27,32 @@ describe Chef::Node do
|
|
27
27
|
it_behaves_like "a platform introspector"
|
28
28
|
|
29
29
|
it "creates a node and assigns it a name" do
|
30
|
-
node = Chef::Node.build(
|
31
|
-
expect(node.name).to eq(
|
30
|
+
node = Chef::Node.build("solo-node")
|
31
|
+
expect(node.name).to eq("solo-node")
|
32
32
|
end
|
33
33
|
|
34
34
|
it "should validate the name of the node" do
|
35
|
-
expect{Chef::Node.build(
|
35
|
+
expect { Chef::Node.build("solo node") }.to raise_error(Chef::Exceptions::ValidationFailed)
|
36
36
|
end
|
37
37
|
|
38
38
|
it "should be sortable" do
|
39
|
-
n1 = Chef::Node.build(
|
40
|
-
n2 = Chef::Node.build(
|
41
|
-
n3 = Chef::Node.build(
|
39
|
+
n1 = Chef::Node.build("alpha")
|
40
|
+
n2 = Chef::Node.build("beta")
|
41
|
+
n3 = Chef::Node.build("omega")
|
42
42
|
expect([n3, n1, n2].sort).to eq([n1, n2, n3])
|
43
43
|
end
|
44
44
|
|
45
45
|
it "should share identity only with others of the same name" do
|
46
|
-
n1 = Chef::Node.build(
|
47
|
-
n2 = Chef::Node.build(
|
48
|
-
n3 = Chef::Node.build(
|
46
|
+
n1 = Chef::Node.build("foo")
|
47
|
+
n2 = Chef::Node.build("foo")
|
48
|
+
n3 = Chef::Node.build("bar")
|
49
49
|
expect(n1).to eq(n2)
|
50
50
|
expect(n1).not_to eq(n3)
|
51
51
|
end
|
52
52
|
|
53
53
|
describe "when the node does not exist on the server" do
|
54
54
|
before do
|
55
|
-
response = OpenStruct.new(:code =>
|
55
|
+
response = OpenStruct.new(:code => "404")
|
56
56
|
exception = Net::HTTPServerException.new("404 not found", response)
|
57
57
|
allow(Chef::Node).to receive(:load).and_raise(exception)
|
58
58
|
node.name("created-node")
|
@@ -62,19 +62,19 @@ describe Chef::Node do
|
|
62
62
|
allow(Chef::Node).to receive(:new).and_return(node)
|
63
63
|
expect(node).to receive(:create).and_return(node)
|
64
64
|
node = Chef::Node.find_or_create("created-node")
|
65
|
-
expect(node.name).to eq(
|
65
|
+
expect(node.name).to eq("created-node")
|
66
66
|
expect(node).to equal(node)
|
67
67
|
end
|
68
68
|
end
|
69
69
|
|
70
70
|
describe "when the node exists on the server" do
|
71
71
|
before do
|
72
|
-
node.name(
|
72
|
+
node.name("existing-node")
|
73
73
|
allow(Chef::Node).to receive(:load).and_return(node)
|
74
74
|
end
|
75
75
|
|
76
76
|
it "loads the node via the REST API for find_or_create" do
|
77
|
-
expect(Chef::Node.find_or_create(
|
77
|
+
expect(Chef::Node.find_or_create("existing-node")).to equal(node)
|
78
78
|
end
|
79
79
|
end
|
80
80
|
|
@@ -88,7 +88,7 @@ describe Chef::Node do
|
|
88
88
|
describe "initialize" do
|
89
89
|
it "should default to the '_default' chef_environment" do
|
90
90
|
n = Chef::Node.new
|
91
|
-
expect(n.chef_environment).to eq(
|
91
|
+
expect(n.chef_environment).to eq("_default")
|
92
92
|
end
|
93
93
|
end
|
94
94
|
|
@@ -107,11 +107,11 @@ describe Chef::Node do
|
|
107
107
|
end
|
108
108
|
|
109
109
|
it "cannot be blank" do
|
110
|
-
expect { node.name("")}.to raise_error(Chef::Exceptions::ValidationFailed)
|
110
|
+
expect { node.name("") }.to raise_error(Chef::Exceptions::ValidationFailed)
|
111
111
|
end
|
112
112
|
|
113
113
|
it "should not accept name doesn't match /^[\-[:alnum:]_:.]+$/" do
|
114
|
-
expect { node.name("space in it")}.to raise_error(Chef::Exceptions::ValidationFailed)
|
114
|
+
expect { node.name("space in it") }.to raise_error(Chef::Exceptions::ValidationFailed)
|
115
115
|
end
|
116
116
|
end
|
117
117
|
|
@@ -131,7 +131,7 @@ describe Chef::Node do
|
|
131
131
|
end
|
132
132
|
|
133
133
|
it "cannot be blank" do
|
134
|
-
expect { node.chef_environment("")}.to raise_error(Chef::Exceptions::ValidationFailed)
|
134
|
+
expect { node.chef_environment("") }.to raise_error(Chef::Exceptions::ValidationFailed)
|
135
135
|
end
|
136
136
|
end
|
137
137
|
|
@@ -147,7 +147,7 @@ describe Chef::Node do
|
|
147
147
|
end
|
148
148
|
|
149
149
|
it "allows policy_name with every valid character" do
|
150
|
-
expect { node.policy_name =
|
150
|
+
expect { node.policy_name = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqurstuvwxyz0123456789-_:." }.to_not raise_error
|
151
151
|
end
|
152
152
|
|
153
153
|
it "sets policy_name when given an argument" do
|
@@ -167,7 +167,7 @@ describe Chef::Node do
|
|
167
167
|
end
|
168
168
|
|
169
169
|
it "cannot be blank" do
|
170
|
-
expect { node.policy_name("")}.to raise_error(Chef::Exceptions::ValidationFailed)
|
170
|
+
expect { node.policy_name("") }.to raise_error(Chef::Exceptions::ValidationFailed)
|
171
171
|
end
|
172
172
|
end
|
173
173
|
|
@@ -183,7 +183,7 @@ describe Chef::Node do
|
|
183
183
|
end
|
184
184
|
|
185
185
|
it "allows policy_group with every valid character" do
|
186
|
-
expect { node.policy_group =
|
186
|
+
expect { node.policy_group = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqurstuvwxyz0123456789-_:." }.to_not raise_error
|
187
187
|
end
|
188
188
|
|
189
189
|
it "sets an environment with chef_environment(something)" do
|
@@ -203,7 +203,7 @@ describe Chef::Node do
|
|
203
203
|
end
|
204
204
|
|
205
205
|
it "cannot be blank" do
|
206
|
-
expect { node.policy_group("")}.to raise_error(Chef::Exceptions::ValidationFailed)
|
206
|
+
expect { node.policy_group("") }.to raise_error(Chef::Exceptions::ValidationFailed)
|
207
207
|
end
|
208
208
|
end
|
209
209
|
|
@@ -223,7 +223,7 @@ describe Chef::Node do
|
|
223
223
|
end
|
224
224
|
|
225
225
|
it "does not allow you to set an attribute via node[]=" do
|
226
|
-
expect
|
226
|
+
expect { node["secret"] = "shush" }.to raise_error(Chef::Exceptions::ImmutableAttributeModification)
|
227
227
|
end
|
228
228
|
|
229
229
|
it "should allow you to query whether an attribute exists with attribute?" do
|
@@ -239,7 +239,7 @@ describe Chef::Node do
|
|
239
239
|
end
|
240
240
|
|
241
241
|
it "does not allow you to set an attribute via method_missing" do
|
242
|
-
expect { node.sunshine = "is bright"}.to raise_error(Chef::Exceptions::ImmutableAttributeModification)
|
242
|
+
expect { node.sunshine = "is bright" }.to raise_error(Chef::Exceptions::ImmutableAttributeModification)
|
243
243
|
end
|
244
244
|
|
245
245
|
it "should allow you get get an attribute via method_missing" do
|
@@ -264,6 +264,12 @@ describe Chef::Node do
|
|
264
264
|
expect(node[:snoopy][:is_a_puppy]).to eq(true)
|
265
265
|
end
|
266
266
|
|
267
|
+
it "should allow you to set an attribute with set_unless if is a nil value" do
|
268
|
+
node.attributes.normal = { snoopy: { is_a_puppy: nil } }
|
269
|
+
node.set_unless[:snoopy][:is_a_puppy] = false
|
270
|
+
expect(node[:snoopy][:is_a_puppy]).to eq(false)
|
271
|
+
end
|
272
|
+
|
267
273
|
it "should allow you to set a value after a set_unless" do
|
268
274
|
# this tests for set_unless_present state bleeding between statements CHEF-3806
|
269
275
|
node.set_unless[:snoopy][:is_a_puppy] = false
|
@@ -285,9 +291,9 @@ describe Chef::Node do
|
|
285
291
|
end
|
286
292
|
|
287
293
|
it "should let you use tag as a convience method for the tags attribute" do
|
288
|
-
node.normal[
|
289
|
-
node.tag(
|
290
|
-
expect(node[
|
294
|
+
node.normal["tags"] = ["one", "two"]
|
295
|
+
node.tag("three", "four")
|
296
|
+
expect(node["tags"]).to eq(["one", "two", "three", "four"])
|
291
297
|
end
|
292
298
|
end
|
293
299
|
|
@@ -383,7 +389,7 @@ describe Chef::Node do
|
|
383
389
|
|
384
390
|
it "deletes nested things correctly" do
|
385
391
|
node.default["mysql"]["client"]["client_setting"] = "foo"
|
386
|
-
expect( node.rm("mysql", "server") ).to eql( {"port" => 3456} )
|
392
|
+
expect( node.rm("mysql", "server") ).to eql( { "port" => 3456 } )
|
387
393
|
expect( node["mysql"] ).to eql( { "client" => { "client_setting" => "foo" } } )
|
388
394
|
end
|
389
395
|
|
@@ -392,7 +398,7 @@ describe Chef::Node do
|
|
392
398
|
end
|
393
399
|
|
394
400
|
it "can delete the entire tree" do
|
395
|
-
expect( node.rm("mysql") ).to eql({"server"=>{"port"=>3456}})
|
401
|
+
expect( node.rm("mysql") ).to eql({ "server" => { "port" => 3456 } })
|
396
402
|
end
|
397
403
|
end
|
398
404
|
|
@@ -432,13 +438,13 @@ describe Chef::Node do
|
|
432
438
|
context "with real arrays" do
|
433
439
|
before do
|
434
440
|
node.role_default["mysql"]["server"] = [ {
|
435
|
-
"port" => 1234
|
441
|
+
"port" => 1234
|
436
442
|
} ]
|
437
443
|
node.normal["mysql"]["server"] = [ {
|
438
|
-
"port" => 2345
|
444
|
+
"port" => 2345
|
439
445
|
} ]
|
440
446
|
node.override["mysql"]["server"] = [ {
|
441
|
-
"port" => 3456
|
447
|
+
"port" => 3456
|
442
448
|
} ]
|
443
449
|
end
|
444
450
|
|
@@ -604,12 +610,12 @@ describe Chef::Node do
|
|
604
610
|
node.force_default["mysql"]["server"]["port"] = 2345
|
605
611
|
|
606
612
|
node.force_default!["mysql"]["server"] = {
|
607
|
-
"data_dir" => "/my_raid_volume/lib/mysql"
|
613
|
+
"data_dir" => "/my_raid_volume/lib/mysql"
|
608
614
|
}
|
609
615
|
|
610
616
|
expect( node["mysql"]["server"] ).to eql({
|
611
|
-
"data_dir" => "/my_raid_volume/lib/mysql"
|
612
|
-
})
|
617
|
+
"data_dir" => "/my_raid_volume/lib/mysql"
|
618
|
+
},)
|
613
619
|
end
|
614
620
|
|
615
621
|
it "removes all values from the precedence level when setting" do
|
@@ -618,14 +624,14 @@ describe Chef::Node do
|
|
618
624
|
node.force_default["mysql"]["server"]["port"] = 3456
|
619
625
|
|
620
626
|
node.force_default!["mysql"]["server"] = {
|
621
|
-
"data_dir" => "/my_raid_volume/lib/mysql"
|
627
|
+
"data_dir" => "/my_raid_volume/lib/mysql"
|
622
628
|
}
|
623
629
|
|
624
630
|
expect( node["mysql"]["server"]["port"] ).to be_nil
|
625
631
|
expect( node["mysql"]["server"]["data_dir"] ).to eql("/my_raid_volume/lib/mysql")
|
626
632
|
expect( node["mysql"]["server"] ).to eql({
|
627
|
-
"data_dir" => "/my_raid_volume/lib/mysql"
|
628
|
-
})
|
633
|
+
"data_dir" => "/my_raid_volume/lib/mysql"
|
634
|
+
},)
|
629
635
|
end
|
630
636
|
|
631
637
|
it "higher precedence levels are not removed" do
|
@@ -635,7 +641,7 @@ describe Chef::Node do
|
|
635
641
|
node.override["mysql"]["server"]["service_name"] = "fancypants-sql"
|
636
642
|
|
637
643
|
node.force_default!["mysql"]["server"] = {
|
638
|
-
"data_dir" => "/my_raid_volume/lib/mysql"
|
644
|
+
"data_dir" => "/my_raid_volume/lib/mysql"
|
639
645
|
}
|
640
646
|
|
641
647
|
expect( node["mysql"]["server"]["port"] ).to be_nil
|
@@ -643,12 +649,12 @@ describe Chef::Node do
|
|
643
649
|
expect( node["mysql"]["server"] ).to eql({
|
644
650
|
"service_name" => "fancypants-sql",
|
645
651
|
"data_dir" => "/my_raid_volume/lib/mysql",
|
646
|
-
})
|
652
|
+
},)
|
647
653
|
end
|
648
654
|
|
649
655
|
it "will autovivify" do
|
650
656
|
node.force_default!["mysql"]["server"] = {
|
651
|
-
"data_dir" => "/my_raid_volume/lib/mysql"
|
657
|
+
"data_dir" => "/my_raid_volume/lib/mysql"
|
652
658
|
}
|
653
659
|
expect( node["mysql"]["server"]["data_dir"] ).to eql("/my_raid_volume/lib/mysql")
|
654
660
|
end
|
@@ -660,7 +666,7 @@ describe Chef::Node do
|
|
660
666
|
node.default["mysql"]["server"]["service_name"] = "fancypants-sql"
|
661
667
|
|
662
668
|
node.force_override!["mysql"]["server"] = {
|
663
|
-
"data_dir" => "/my_raid_volume/lib/mysql"
|
669
|
+
"data_dir" => "/my_raid_volume/lib/mysql"
|
664
670
|
}
|
665
671
|
|
666
672
|
expect( node["mysql"]["server"]["port"] ).to be_nil
|
@@ -668,14 +674,14 @@ describe Chef::Node do
|
|
668
674
|
expect( node["mysql"]["server"] ).to eql({
|
669
675
|
"service_name" => "fancypants-sql",
|
670
676
|
"data_dir" => "/my_raid_volume/lib/mysql",
|
671
|
-
})
|
677
|
+
},)
|
672
678
|
end
|
673
679
|
|
674
680
|
it "when overwriting a non-hash/array" do
|
675
681
|
node.override["mysql"] = false
|
676
682
|
node.force_override["mysql"] = true
|
677
683
|
node.force_override!["mysql"]["server"] = {
|
678
|
-
"data_dir" => "/my_raid_volume/lib/mysql"
|
684
|
+
"data_dir" => "/my_raid_volume/lib/mysql"
|
679
685
|
}
|
680
686
|
expect( node["mysql"]["server"]["data_dir"] ).to eql("/my_raid_volume/lib/mysql")
|
681
687
|
end
|
@@ -683,11 +689,11 @@ describe Chef::Node do
|
|
683
689
|
it "when overwriting an array with a hash" do
|
684
690
|
node.force_override["mysql"][0] = true
|
685
691
|
node.force_override!["mysql"]["server"] = {
|
686
|
-
"data_dir" => "/my_raid_volume/lib/mysql"
|
692
|
+
"data_dir" => "/my_raid_volume/lib/mysql"
|
687
693
|
}
|
688
694
|
expect( node["mysql"]["server"] ).to eql({
|
689
|
-
"data_dir" => "/my_raid_volume/lib/mysql"
|
690
|
-
})
|
695
|
+
"data_dir" => "/my_raid_volume/lib/mysql"
|
696
|
+
},)
|
691
697
|
end
|
692
698
|
end
|
693
699
|
|
@@ -700,25 +706,25 @@ describe Chef::Node do
|
|
700
706
|
#
|
701
707
|
describe "deep merge attribute cache edge conditions" do
|
702
708
|
it "does not error with complicated attribute substitution" do
|
703
|
-
node.default[
|
704
|
-
node.default[
|
705
|
-
expect { node.default[
|
709
|
+
node.default["chef_attribute_hell"]["attr1"] = "attribute1"
|
710
|
+
node.default["chef_attribute_hell"]["attr2"] = "#{node.chef_attribute_hell.attr1}/attr2"
|
711
|
+
expect { node.default["chef_attribute_hell"]["attr3"] = "#{node.chef_attribute_hell.attr2}/attr3" }.not_to raise_error
|
706
712
|
end
|
707
713
|
|
708
714
|
it "caches both strings and symbols correctly" do
|
709
|
-
node.force_default[:solr][:version] =
|
715
|
+
node.force_default[:solr][:version] = "4.10.2"
|
710
716
|
node.force_default[:solr][:data_dir] = "/opt/solr-#{node['solr'][:version]}/example/solr"
|
711
717
|
node.force_default[:solr][:xms] = "512M"
|
712
718
|
expect(node[:solr][:xms]).to eql("512M")
|
713
|
-
expect(node[
|
719
|
+
expect(node["solr"][:xms]).to eql("512M")
|
714
720
|
end
|
715
721
|
|
716
722
|
it "method interpolation syntax also works" do
|
717
|
-
node.default[
|
718
|
-
node.default[
|
719
|
-
node.default[
|
720
|
-
expect(node[
|
721
|
-
expect(node[:passenger][
|
723
|
+
node.default["passenger"]["version"] = "4.0.57"
|
724
|
+
node.default["passenger"]["root_path"] = "passenger-#{node['passenger']['version']}"
|
725
|
+
node.default["passenger"]["root_path_2"] = "passenger-#{node.passenger['version']}"
|
726
|
+
expect(node["passenger"]["root_path_2"]).to eql("passenger-4.0.57")
|
727
|
+
expect(node[:passenger]["root_path_2"]).to eql("passenger-4.0.57")
|
722
728
|
end
|
723
729
|
end
|
724
730
|
|
@@ -730,7 +736,7 @@ describe Chef::Node do
|
|
730
736
|
node.default.sunshine = "is bright"
|
731
737
|
node.default.canada = "is a nice place"
|
732
738
|
seen_attributes = Hash.new
|
733
|
-
node.each_attribute do |a,v|
|
739
|
+
node.each_attribute do |a, v|
|
734
740
|
seen_attributes[a] = v
|
735
741
|
end
|
736
742
|
expect(seen_attributes).to have_key("sunshine")
|
@@ -743,12 +749,12 @@ describe Chef::Node do
|
|
743
749
|
describe "consuming json" do
|
744
750
|
|
745
751
|
before do
|
746
|
-
@ohai_data = {:platform =>
|
752
|
+
@ohai_data = { :platform => "foo", :platform_version => "bar" }
|
747
753
|
end
|
748
754
|
|
749
755
|
it "consumes the run list portion of a collection of attributes and returns the remainder" do
|
750
|
-
attrs = {"run_list" => [ "role[base]", "recipe[chef::server]" ], "foo" => "bar"}
|
751
|
-
expect(node.consume_run_list(attrs)).to eq({"foo" => "bar"})
|
756
|
+
attrs = { "run_list" => [ "role[base]", "recipe[chef::server]" ], "foo" => "bar" }
|
757
|
+
expect(node.consume_run_list(attrs)).to eq({ "foo" => "bar" })
|
752
758
|
expect(node.run_list).to eq([ "role[base]", "recipe[chef::server]" ])
|
753
759
|
end
|
754
760
|
|
@@ -756,7 +762,7 @@ describe Chef::Node do
|
|
756
762
|
attrs = { "chef_environment" => "foo_environment", "bar" => "baz" }
|
757
763
|
expect(node.consume_chef_environment(attrs)).to eq({ "bar" => "baz" })
|
758
764
|
expect(node.chef_environment).to eq("foo_environment")
|
759
|
-
expect(node[
|
765
|
+
expect(node["chef_environment"]).to be nil
|
760
766
|
end
|
761
767
|
|
762
768
|
it "should overwrites the run list with the run list it consumes" do
|
@@ -768,7 +774,7 @@ describe Chef::Node do
|
|
768
774
|
it "should not add duplicate recipes from the json attributes" do
|
769
775
|
node.run_list << "one"
|
770
776
|
node.consume_run_list "recipes" => [ "one", "two", "three" ]
|
771
|
-
expect(node.run_list).to
|
777
|
+
expect(node.run_list).to eq([ "one", "two", "three" ])
|
772
778
|
end
|
773
779
|
|
774
780
|
it "doesn't change the run list if no run_list is specified in the json" do
|
@@ -782,7 +788,7 @@ describe Chef::Node do
|
|
782
788
|
end
|
783
789
|
|
784
790
|
it "should add json attributes to the node" do
|
785
|
-
node.consume_external_attrs(@ohai_data, {"one" => "two", "three" => "four"})
|
791
|
+
node.consume_external_attrs(@ohai_data, { "one" => "two", "three" => "four" })
|
786
792
|
expect(node.one).to eql("two")
|
787
793
|
expect(node.three).to eql("four")
|
788
794
|
end
|
@@ -798,45 +804,63 @@ describe Chef::Node do
|
|
798
804
|
expect(node.tags).to eql([ "radiohead" ])
|
799
805
|
end
|
800
806
|
|
807
|
+
it "should set the tags attribute to an empty array if it is nil" do
|
808
|
+
node.attributes.normal = { "tags" => nil }
|
809
|
+
node.consume_external_attrs(@ohai_data, {})
|
810
|
+
expect(node.tags).to eql([])
|
811
|
+
end
|
812
|
+
|
813
|
+
it "should return an array if it is fed a string" do
|
814
|
+
node.normal[:tags] = "string"
|
815
|
+
node.consume_external_attrs(@ohai_data, {})
|
816
|
+
expect(node.tags).to eql(["string"])
|
817
|
+
end
|
818
|
+
|
819
|
+
it "should return an array if it is fed a hash" do
|
820
|
+
node.normal[:tags] = {}
|
821
|
+
node.consume_external_attrs(@ohai_data, {})
|
822
|
+
expect(node.tags).to eql([])
|
823
|
+
end
|
824
|
+
|
801
825
|
it "deep merges attributes instead of overwriting them" do
|
802
|
-
node.consume_external_attrs(@ohai_data, "one" => {"two" => {"three" => "four"}})
|
803
|
-
expect(node.one.to_hash).to eq({"two" => {"three" => "four"}})
|
804
|
-
node.consume_external_attrs(@ohai_data, "one" => {"abc" => "123"})
|
805
|
-
node.consume_external_attrs(@ohai_data, "one" => {"two" => {"foo" => "bar"}})
|
806
|
-
expect(node.one.to_hash).to eq({"two" => {"three" => "four", "foo" => "bar"}, "abc" => "123"})
|
826
|
+
node.consume_external_attrs(@ohai_data, "one" => { "two" => { "three" => "four" } })
|
827
|
+
expect(node.one.to_hash).to eq({ "two" => { "three" => "four" } })
|
828
|
+
node.consume_external_attrs(@ohai_data, "one" => { "abc" => "123" })
|
829
|
+
node.consume_external_attrs(@ohai_data, "one" => { "two" => { "foo" => "bar" } })
|
830
|
+
expect(node.one.to_hash).to eq({ "two" => { "three" => "four", "foo" => "bar" }, "abc" => "123" })
|
807
831
|
end
|
808
832
|
|
809
833
|
it "gives attributes from JSON priority when deep merging" do
|
810
|
-
node.consume_external_attrs(@ohai_data, "one" => {"two" => {"three" => "four"}})
|
811
|
-
expect(node.one.to_hash).to eq({"two" => {"three" => "four"}})
|
812
|
-
node.consume_external_attrs(@ohai_data, "one" => {"two" => {"three" => "forty-two"}})
|
813
|
-
expect(node.one.to_hash).to eq({"two" => {"three" => "forty-two"}})
|
834
|
+
node.consume_external_attrs(@ohai_data, "one" => { "two" => { "three" => "four" } })
|
835
|
+
expect(node.one.to_hash).to eq({ "two" => { "three" => "four" } })
|
836
|
+
node.consume_external_attrs(@ohai_data, "one" => { "two" => { "three" => "forty-two" } })
|
837
|
+
expect(node.one.to_hash).to eq({ "two" => { "three" => "forty-two" } })
|
814
838
|
end
|
815
839
|
|
816
840
|
end
|
817
841
|
|
818
842
|
describe "preparing for a chef client run" do
|
819
843
|
before do
|
820
|
-
@ohai_data = {:platform =>
|
844
|
+
@ohai_data = { :platform => "foobuntu", :platform_version => "23.42" }
|
821
845
|
end
|
822
846
|
|
823
847
|
it "sets its platform according to platform detection" do
|
824
848
|
node.consume_external_attrs(@ohai_data, {})
|
825
|
-
expect(node.automatic_attrs[:platform]).to eq(
|
826
|
-
expect(node.automatic_attrs[:platform_version]).to eq(
|
849
|
+
expect(node.automatic_attrs[:platform]).to eq("foobuntu")
|
850
|
+
expect(node.automatic_attrs[:platform_version]).to eq("23.42")
|
827
851
|
end
|
828
852
|
|
829
853
|
it "consumes the run list from provided json attributes" do
|
830
|
-
node.consume_external_attrs(@ohai_data, {"run_list" => [
|
831
|
-
expect(node.run_list).to eq([
|
854
|
+
node.consume_external_attrs(@ohai_data, { "run_list" => ["recipe[unicorn]"] })
|
855
|
+
expect(node.run_list).to eq(["recipe[unicorn]"])
|
832
856
|
end
|
833
857
|
|
834
858
|
it "saves non-runlist json attrs for later" do
|
835
|
-
expansion = Chef::RunList::RunListExpansion.new(
|
859
|
+
expansion = Chef::RunList::RunListExpansion.new("_default", [])
|
836
860
|
allow(node.run_list).to receive(:expand).and_return(expansion)
|
837
|
-
node.consume_external_attrs(@ohai_data, {"foo" => "bar"})
|
861
|
+
node.consume_external_attrs(@ohai_data, { "foo" => "bar" })
|
838
862
|
node.expand!
|
839
|
-
expect(node.normal_attrs).to eq({"foo" => "bar", "tags" => []})
|
863
|
+
expect(node.normal_attrs).to eq({ "foo" => "bar", "tags" => [] })
|
840
864
|
end
|
841
865
|
|
842
866
|
end
|
@@ -844,7 +868,7 @@ describe Chef::Node do
|
|
844
868
|
describe "when expanding its run list and merging attributes" do
|
845
869
|
before do
|
846
870
|
@environment = Chef::Environment.new.tap do |e|
|
847
|
-
e.name(
|
871
|
+
e.name("rspec_env")
|
848
872
|
e.default_attributes("env default key" => "env default value")
|
849
873
|
e.override_attributes("env override key" => "env override value")
|
850
874
|
end
|
@@ -855,15 +879,15 @@ describe Chef::Node do
|
|
855
879
|
end
|
856
880
|
|
857
881
|
it "sets the 'recipes' automatic attribute to the recipes in the expanded run_list" do
|
858
|
-
@expansion.recipes <<
|
882
|
+
@expansion.recipes << "recipe[chef::client]" << "recipe[nginx::default]"
|
859
883
|
node.expand!
|
860
|
-
expect(node.automatic_attrs[:recipes]).to eq([
|
884
|
+
expect(node.automatic_attrs[:recipes]).to eq(["recipe[chef::client]", "recipe[nginx::default]"])
|
861
885
|
end
|
862
886
|
|
863
887
|
it "sets the 'roles' automatic attribute to the expanded role list" do
|
864
|
-
@expansion.instance_variable_set(:@applied_roles, {
|
888
|
+
@expansion.instance_variable_set(:@applied_roles, { "arf" => nil, "countersnark" => nil })
|
865
889
|
node.expand!
|
866
|
-
expect(node.automatic_attrs[:roles].sort).to eq([
|
890
|
+
expect(node.automatic_attrs[:roles].sort).to eq(["arf", "countersnark"])
|
867
891
|
end
|
868
892
|
|
869
893
|
it "applies default attributes from the environment as environment defaults" do
|
@@ -961,12 +985,12 @@ describe Chef::Node do
|
|
961
985
|
before do
|
962
986
|
node.chef_environment = "rspec"
|
963
987
|
@expansion = Chef::RunList::RunListExpansion.new("rspec", [])
|
964
|
-
@expansion.default_attrs.replace({:default => "from role", :d_role => "role only"})
|
965
|
-
@expansion.override_attrs.replace({:override => "from role", :o_role => "role only"})
|
988
|
+
@expansion.default_attrs.replace({ :default => "from role", :d_role => "role only" })
|
989
|
+
@expansion.override_attrs.replace({ :override => "from role", :o_role => "role only" })
|
966
990
|
|
967
991
|
@environment = Chef::Environment.new
|
968
|
-
@environment.default_attributes = {:default => "from env", :d_env => "env only" }
|
969
|
-
@environment.override_attributes = {:override => "from env", :o_env => "env only"}
|
992
|
+
@environment.default_attributes = { :default => "from env", :d_env => "env only" }
|
993
|
+
@environment.override_attributes = { :override => "from env", :o_env => "env only" }
|
970
994
|
allow(Chef::Environment).to receive(:load).and_return(@environment)
|
971
995
|
node.apply_expansion_attributes(@expansion)
|
972
996
|
end
|
@@ -1128,7 +1152,7 @@ describe Chef::Node do
|
|
1128
1152
|
expect(h["chef_environment"]).to eq("dev")
|
1129
1153
|
end
|
1130
1154
|
|
1131
|
-
it
|
1155
|
+
it "should return an empty array for empty run_list" do
|
1132
1156
|
expect(node.to_hash["run_list"]).to eq([])
|
1133
1157
|
end
|
1134
1158
|
end
|
@@ -1146,11 +1170,11 @@ describe Chef::Node do
|
|
1146
1170
|
expect(json).to match(/run_list/)
|
1147
1171
|
end
|
1148
1172
|
|
1149
|
-
it
|
1173
|
+
it "should serialize valid json with a run list", :json => true do
|
1150
1174
|
#This test came about because activesupport mucks with Chef json serialization
|
1151
1175
|
#Test should pass with and without Activesupport
|
1152
|
-
node.run_list << {"type" => "role", "name" =>
|
1153
|
-
node.run_list << {"type" => "role", "name" =>
|
1176
|
+
node.run_list << { "type" => "role", "name" => "Cthulu" }
|
1177
|
+
node.run_list << { "type" => "role", "name" => "Hastur" }
|
1154
1178
|
json = Chef::JSONCompat.to_json(node)
|
1155
1179
|
expect(json).to match(/\"run_list\":\[\"role\[Cthulu\]\",\"role\[Hastur\]\"\]/)
|
1156
1180
|
end
|
@@ -1183,11 +1207,11 @@ describe Chef::Node do
|
|
1183
1207
|
it "should deserialize itself from json", :json => true do
|
1184
1208
|
node.from_file(File.expand_path("nodes/test.example.com.rb", CHEF_SPEC_DATA))
|
1185
1209
|
json = Chef::JSONCompat.to_json(node)
|
1186
|
-
serialized_node = Chef::JSONCompat.
|
1210
|
+
serialized_node = Chef::Node.from_hash(Chef::JSONCompat.parse(json))
|
1187
1211
|
expect(serialized_node).to be_a_kind_of(Chef::Node)
|
1188
1212
|
expect(serialized_node.name).to eql(node.name)
|
1189
1213
|
expect(serialized_node.chef_environment).to eql(node.chef_environment)
|
1190
|
-
node.each_attribute do |k,v|
|
1214
|
+
node.each_attribute do |k, v|
|
1191
1215
|
expect(serialized_node[k]).to eql(v)
|
1192
1216
|
end
|
1193
1217
|
expect(serialized_node.run_list).to eq(node.run_list)
|
@@ -1222,7 +1246,7 @@ describe Chef::Node do
|
|
1222
1246
|
end
|
1223
1247
|
|
1224
1248
|
it "parses policyfile attributes from JSON" do
|
1225
|
-
round_tripped_node = Chef::Node.
|
1249
|
+
round_tripped_node = Chef::Node.from_hash(node.for_json)
|
1226
1250
|
|
1227
1251
|
expect(round_tripped_node.policy_name).to eq("my-application")
|
1228
1252
|
expect(round_tripped_node.policy_group).to eq("staging")
|
@@ -1247,8 +1271,8 @@ describe Chef::Node do
|
|
1247
1271
|
|
1248
1272
|
describe "api model" do
|
1249
1273
|
before(:each) do
|
1250
|
-
@rest = double("Chef::
|
1251
|
-
allow(Chef::
|
1274
|
+
@rest = double("Chef::ServerAPI")
|
1275
|
+
allow(Chef::ServerAPI).to receive(:new).and_return(@rest)
|
1252
1276
|
@query = double("Chef::Search::Query")
|
1253
1277
|
allow(Chef::Search::Query).to receive(:new).and_return(@query)
|
1254
1278
|
end
|
@@ -1257,6 +1281,7 @@ describe Chef::Node do
|
|
1257
1281
|
describe "inflated" do
|
1258
1282
|
it "should return a hash of node names and objects" do
|
1259
1283
|
n1 = double("Chef::Node", :name => "one")
|
1284
|
+
allow(n1).to receive(:kind_of?).with(Chef::Node) { true }
|
1260
1285
|
expect(@query).to receive(:search).with(:node).and_yield(n1)
|
1261
1286
|
r = Chef::Node.list(true)
|
1262
1287
|
expect(r["one"]).to eq(n1)
|
@@ -1264,7 +1289,7 @@ describe Chef::Node do
|
|
1264
1289
|
end
|
1265
1290
|
|
1266
1291
|
it "should return a hash of node names and urls" do
|
1267
|
-
expect(@rest).to receive(:
|
1292
|
+
expect(@rest).to receive(:get).and_return({ "one" => "http://foo" })
|
1268
1293
|
r = Chef::Node.list
|
1269
1294
|
expect(r["one"]).to eq("http://foo")
|
1270
1295
|
end
|
@@ -1272,14 +1297,19 @@ describe Chef::Node do
|
|
1272
1297
|
|
1273
1298
|
describe "load" do
|
1274
1299
|
it "should load a node by name" do
|
1275
|
-
|
1276
|
-
|
1300
|
+
node.from_file(File.expand_path("nodes/test.example.com.rb", CHEF_SPEC_DATA))
|
1301
|
+
json = Chef::JSONCompat.to_json(node)
|
1302
|
+
parsed = Chef::JSONCompat.parse(json)
|
1303
|
+
expect(@rest).to receive(:get).with("nodes/test.example.com").and_return(parsed)
|
1304
|
+
serialized_node = Chef::Node.load("test.example.com")
|
1305
|
+
expect(serialized_node).to be_a_kind_of(Chef::Node)
|
1306
|
+
expect(serialized_node.name).to eql(node.name)
|
1277
1307
|
end
|
1278
1308
|
end
|
1279
1309
|
|
1280
1310
|
describe "destroy" do
|
1281
1311
|
it "should destroy a node" do
|
1282
|
-
expect(@rest).to receive(:
|
1312
|
+
expect(@rest).to receive(:delete).with("nodes/monkey").and_return("foo")
|
1283
1313
|
node.name("monkey")
|
1284
1314
|
node.destroy
|
1285
1315
|
end
|
@@ -1289,15 +1319,15 @@ describe Chef::Node do
|
|
1289
1319
|
it "should update a node if it already exists" do
|
1290
1320
|
node.name("monkey")
|
1291
1321
|
allow(node).to receive(:data_for_save).and_return({})
|
1292
|
-
expect(@rest).to receive(:
|
1322
|
+
expect(@rest).to receive(:put).with("nodes/monkey", {}).and_return("foo")
|
1293
1323
|
node.save
|
1294
1324
|
end
|
1295
1325
|
|
1296
1326
|
it "should not try and create if it can update" do
|
1297
1327
|
node.name("monkey")
|
1298
1328
|
allow(node).to receive(:data_for_save).and_return({})
|
1299
|
-
expect(@rest).to receive(:
|
1300
|
-
expect(@rest).not_to receive(:
|
1329
|
+
expect(@rest).to receive(:put).with("nodes/monkey", {}).and_return("foo")
|
1330
|
+
expect(@rest).not_to receive(:post)
|
1301
1331
|
node.save
|
1302
1332
|
end
|
1303
1333
|
|
@@ -1305,8 +1335,8 @@ describe Chef::Node do
|
|
1305
1335
|
node.name("monkey")
|
1306
1336
|
allow(node).to receive(:data_for_save).and_return({})
|
1307
1337
|
exception = double("404 error", :code => "404")
|
1308
|
-
expect(@rest).to receive(:
|
1309
|
-
expect(@rest).to receive(:
|
1338
|
+
expect(@rest).to receive(:put).and_raise(Net::HTTPServerException.new("foo", exception))
|
1339
|
+
expect(@rest).to receive(:post).with("nodes", {})
|
1310
1340
|
node.save
|
1311
1341
|
end
|
1312
1342
|
|
@@ -1319,8 +1349,8 @@ describe Chef::Node do
|
|
1319
1349
|
end
|
1320
1350
|
it "should not save" do
|
1321
1351
|
node.name("monkey")
|
1322
|
-
expect(@rest).not_to receive(:
|
1323
|
-
expect(@rest).not_to receive(:
|
1352
|
+
expect(@rest).not_to receive(:put)
|
1353
|
+
expect(@rest).not_to receive(:post)
|
1324
1354
|
node.save
|
1325
1355
|
end
|
1326
1356
|
end
|
@@ -1329,21 +1359,21 @@ describe Chef::Node do
|
|
1329
1359
|
it "should only save whitelisted attributes (and subattributes)" do
|
1330
1360
|
Chef::Config[:automatic_attribute_whitelist] = [
|
1331
1361
|
["filesystem", "/dev/disk0s2"],
|
1332
|
-
"network/interfaces/eth0"
|
1362
|
+
"network/interfaces/eth0",
|
1333
1363
|
]
|
1334
1364
|
|
1335
1365
|
data = {
|
1336
1366
|
"automatic" => {
|
1337
1367
|
"filesystem" => {
|
1338
1368
|
"/dev/disk0s2" => { "size" => "10mb" },
|
1339
|
-
"map - autohome" => { "size" => "10mb" }
|
1369
|
+
"map - autohome" => { "size" => "10mb" },
|
1340
1370
|
},
|
1341
1371
|
"network" => {
|
1342
1372
|
"interfaces" => {
|
1343
1373
|
"eth0" => {},
|
1344
|
-
"eth1" => {}
|
1374
|
+
"eth1" => {},
|
1345
1375
|
}
|
1346
|
-
}
|
1376
|
+
},
|
1347
1377
|
},
|
1348
1378
|
"default" => {}, "normal" => {}, "override" => {}
|
1349
1379
|
}
|
@@ -1357,14 +1387,14 @@ describe Chef::Node do
|
|
1357
1387
|
"interfaces" => {
|
1358
1388
|
"eth0" => {}
|
1359
1389
|
}
|
1360
|
-
}
|
1390
|
+
},
|
1361
1391
|
},
|
1362
1392
|
"default" => {}, "normal" => {}, "override" => {}
|
1363
1393
|
}
|
1364
1394
|
|
1365
1395
|
node.name("picky-monkey")
|
1366
1396
|
allow(node).to receive(:for_json).and_return(data)
|
1367
|
-
expect(@rest).to receive(:
|
1397
|
+
expect(@rest).to receive(:put).with("nodes/picky-monkey", selected_data).and_return("foo")
|
1368
1398
|
node.save
|
1369
1399
|
end
|
1370
1400
|
|
@@ -1377,11 +1407,11 @@ describe Chef::Node do
|
|
1377
1407
|
"default" => {
|
1378
1408
|
"foo" => {
|
1379
1409
|
"bar" => {
|
1380
|
-
"baz" => false
|
1410
|
+
"baz" => false
|
1381
1411
|
},
|
1382
1412
|
"other" => {
|
1383
|
-
"stuff" => true
|
1384
|
-
}
|
1413
|
+
"stuff" => true
|
1414
|
+
},
|
1385
1415
|
}
|
1386
1416
|
}
|
1387
1417
|
}
|
@@ -1390,7 +1420,7 @@ describe Chef::Node do
|
|
1390
1420
|
"default" => {
|
1391
1421
|
"foo" => {
|
1392
1422
|
"bar" => {
|
1393
|
-
"baz" => false
|
1423
|
+
"baz" => false
|
1394
1424
|
}
|
1395
1425
|
}
|
1396
1426
|
}
|
@@ -1398,7 +1428,7 @@ describe Chef::Node do
|
|
1398
1428
|
|
1399
1429
|
node.name("falsey-monkey")
|
1400
1430
|
allow(node).to receive(:for_json).and_return(data)
|
1401
|
-
expect(@rest).to receive(:
|
1431
|
+
expect(@rest).to receive(:put).with("nodes/falsey-monkey", selected_data).and_return("foo")
|
1402
1432
|
node.save
|
1403
1433
|
end
|
1404
1434
|
|
@@ -1409,7 +1439,7 @@ describe Chef::Node do
|
|
1409
1439
|
"automatic" => {
|
1410
1440
|
"filesystem" => {
|
1411
1441
|
"/dev/disk0s2" => { "size" => "10mb" },
|
1412
|
-
"map - autohome" => { "size" => "10mb" }
|
1442
|
+
"map - autohome" => { "size" => "10mb" },
|
1413
1443
|
}
|
1414
1444
|
},
|
1415
1445
|
"default" => {}, "normal" => {}, "override" => {}
|
@@ -1421,7 +1451,7 @@ describe Chef::Node do
|
|
1421
1451
|
|
1422
1452
|
node.name("picky-monkey")
|
1423
1453
|
allow(node).to receive(:for_json).and_return(data)
|
1424
|
-
expect(@rest).to receive(:
|
1454
|
+
expect(@rest).to receive(:put).with("nodes/picky-monkey", selected_data).and_return("foo")
|
1425
1455
|
node.save
|
1426
1456
|
end
|
1427
1457
|
end
|
@@ -1437,12 +1467,12 @@ describe Chef::Node do
|
|
1437
1467
|
context "and the server supports policyfile attributes in node JSON" do
|
1438
1468
|
|
1439
1469
|
it "creates the object normally" do
|
1440
|
-
expect(@rest).to receive(:
|
1470
|
+
expect(@rest).to receive(:post).with("nodes", node.for_json)
|
1441
1471
|
node.create
|
1442
1472
|
end
|
1443
1473
|
|
1444
1474
|
it "saves the node object normally" do
|
1445
|
-
expect(@rest).to receive(:
|
1475
|
+
expect(@rest).to receive(:put).with("nodes/example-node", node.for_json)
|
1446
1476
|
node.save
|
1447
1477
|
end
|
1448
1478
|
end
|
@@ -1490,8 +1520,8 @@ describe Chef::Node do
|
|
1490
1520
|
context "when the node exists" do
|
1491
1521
|
|
1492
1522
|
it "falls back to saving without policyfile attributes" do
|
1493
|
-
expect(@rest).to receive(:
|
1494
|
-
expect(@rest).to receive(:
|
1523
|
+
expect(@rest).to receive(:put).with("nodes/example-node", node.for_json).and_raise(http_exception)
|
1524
|
+
expect(@rest).to receive(:put).with("nodes/example-node", trimmed_node).and_return(@node)
|
1495
1525
|
expect { node.save }.to_not raise_error
|
1496
1526
|
end
|
1497
1527
|
|
@@ -1512,15 +1542,15 @@ describe Chef::Node do
|
|
1512
1542
|
end
|
1513
1543
|
|
1514
1544
|
it "falls back to saving without policyfile attributes" do
|
1515
|
-
expect(@rest).to receive(:
|
1516
|
-
expect(@rest).to receive(:
|
1517
|
-
expect(@rest).to receive(:
|
1545
|
+
expect(@rest).to receive(:put).with("nodes/example-node", node.for_json).and_raise(http_exception)
|
1546
|
+
expect(@rest).to receive(:put).with("nodes/example-node", trimmed_node).and_raise(http_exception_404)
|
1547
|
+
expect(@rest).to receive(:post).with("nodes", trimmed_node).and_return(@node)
|
1518
1548
|
node.save
|
1519
1549
|
end
|
1520
1550
|
|
1521
1551
|
it "creates the node without policyfile attributes" do
|
1522
|
-
expect(@rest).to receive(:
|
1523
|
-
expect(@rest).to receive(:
|
1552
|
+
expect(@rest).to receive(:post).with("nodes", node.for_json).and_raise(http_exception)
|
1553
|
+
expect(@rest).to receive(:post).with("nodes", trimmed_node).and_return(@node)
|
1524
1554
|
node.create
|
1525
1555
|
end
|
1526
1556
|
end
|