summaryrefslogtreecommitdiff
path: root/spec
Commit message (Collapse)AuthorAgeFilesLines
* Better target mode no-creds errorslcg/better-target-mode-creds-errorsLamont Granquist2019-05-201-9/+14
| | | | | | | | | | | | | | | | Changes the target mode error in the case of no creds at all to: ``` FATAL: ArgumentError: Credentials file specified for target mode does not exist: '/Users/lamont/.chef/credentials' ``` From: ``` [2019-05-20T17:30:41-07:00] FATAL: NoMethodError: undefined method `[]' for nil:NilClass ``` Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Enable pty for bootstrap sshbootstrap-uses-ptyMarc A. Paradise2019-05-161-14/+23
| | | | | | | | This will allow bootstrap to work with systems that have `requiretty` configured, and is consistent with the behavior of Chef 14 bootstrap Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
* Bootstrap updatesmp/bootstrap-updatesMarc A. Paradise2019-05-141-12/+41
| | | | | | | | | | | | | | | | | | | This includes a few fixes: 1. properly handle the default value for session_timeout in cases where merge_config is not called (plugins) to populate defaults. 2. verify that we're using the ssh protoocl before referencing ssh constants. 3. capture and compare the higher-level Train::Error for the check to see if we've gotten a missing fingerprint error, instead of using Train::Transports::SSHFailed which may not be loaded when exception is being evaluated. 4. Add tests for missing fingerprint behavior 5. do not save session_timeout to Chef::Config[:knife], it was not referenced as knife config in any location and we're trying to move away from pushing CLI values into knife config. Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
* Rename the windows_dfs :install actions to :createTim Smith2019-05-132-8/+8
| | | | | | We're creating these dfs shares so it makes a lot more sense to make the action create. This is probably what people using Chef would expect. Signed-off-by: Tim Smith <tsmith@chef.io>
* Merge pull request #8521 from ↵Bryan McLellan2019-05-131-7/+56
|\ | | | | | | | | MsysTechnologiesllc/VSingh/bootstrap-session-timeout Chef 15: Add --session-timeout bootstrap option for both ssh & winrm
| * Add a warning when session-timeout is too shortMarc A. Paradise2019-05-131-2/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We converted --winrm-session-timeout MINUTES to --session-timeout SECONDS If someone is providing a short session timeout, it's possible that they're doing so based on the flag accepting minutes. We'll warn them and suggest an alternative so that if things go wrong, they'll know where to start looking. We can remove this once we remove the deprecation for winrm-session-timeout Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
| * Ensure tests are aware of CLI default valuesMarc A. Paradise2019-05-131-3/+7
| | | | | | | | | | | | | | We added default value for session-timeout, but the tests weren't aware of that because config was mocked. Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
| * Minor fixes related to chefstyleVivek Singh2019-05-131-1/+1
| | | | | | | | Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
| * Add --session-timeout bootstrap option for both ssh & winrmVivek Singh2019-05-131-4/+26
| | | | | | | | | | | | | | | | | | - Add bootstrap option --session-timeout. - Add wirnrm-session to deprecations. - Default --session-timeout value is 60 secs(same was added for --winrm-session-timeout). - Modify existing specs related to old winrm session timeout key and add specs for session timeout. Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
* | move retry into #connect!Bryan McLellan2019-05-131-1/+1
| | | | | | | | Signed-off-by: Bryan McLellan <btm@loftninjas.org>
* | Use new Net:SSH host key verify valuesBryan McLellan2019-05-131-2/+2
|/ | | | | | | | | | | | | Fixes #8482 by prompting to continue if the host key is not recognized. This attempts to tell Net:SSH to accept and write the key but it is only temporarily accepting. This changes the parameters of --ssh-verify-host-key (which is new) to take the Net::SSH values, which get passed through by train. This allows the user more options than only verifying or not. Signed-off-by: Bryan McLellan <btm@loftninjas.org>
* Merge pull request #8506 from chef/KNIFE-EC2-567/handle-unmerged-caseTim Smith2019-05-101-0/+25
|\ | | | | [knife-ec2-547] Update config_source to support using knife classes without requiring merge_config
| * Move original config initialization to constructorKNIFE-EC2-567/handle-unmerged-caseMarc A. Paradise2019-05-081-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This moves initialization of @original_config out of merge_configs and into the constructor. A common access pattern for plugins running knife commands is: cmd = KnifeCommand.new cmd.config[:something] = value cmd.run This bypasses the `Knife.run` class method, which does extra config initialization - including merge_configs. When that happens, `config_source` will now return `nil` as the source instead of exploding. Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
* | Merge pull request #8507 from MarkGibbons/solaris_bootstrapTim Smith2019-05-101-0/+22
|\ \ | | | | | | Use exports compatibile with /bin/sh in the bootstrap script
| * | Use exports compatibile with /bin/sh in the bootstrap scriptmarkgibbons2019-05-081-0/+22
| |/ | | | | | | | | | | | | | | | | The bootstrap script is explicitly using /bin/sh. On some solaris servers the version of /bin/sh exporting environment variables using "export id=value" fails. The form "id=value export id" does work. Bootstrap fails when the wrong form is used. Signed-off-by: markgibbons <mark.gibbons@nordstrom.com>
* | Merge pull request #8451 from ↵Bryan McLellan2019-05-101-0/+25
|\ \ | | | | | | | | | | | | MsysTechnologiesllc/Kapil/MSYS-996_Win32APIError_The_operation_completed_successfully Fix for Chef::Exceptions::Win32APIError: The operation completed successfully.
| * | Fix for Chef::Exceptions::Win32APIError: The operation completed successfullyKapil Chouhan2019-05-101-0/+25
| | | | | | | | | | | | Signed-off-by: Kapil Chouhan <kapil.chouhan@msystechnologies.com>
* | | CHEF_LICENSE environment variables should be quotedenv_quotestyler-ball2019-05-091-6/+0
| |/ |/| | | | | | | | | Some shells interpret the '-' character in 'accept-no-persist' Signed-off-by: tyler-ball <tball@chef.io>
* | knife bootstrap should only request license when installing Chef 15knife_licensetyler-ball2019-05-073-18/+50
| | | | | | | | | | | | | | | | Also updating the transmission of the license acceptance through the config.rb because that brings it in line with existing patterns (Test Kitchen). Signed-off-by: tyler-ball <tball@chef.io>
* | Merge pull request #8470 from chef/lcg/remove-collision-deprecationTim Smith2019-05-072-56/+11
|\ \ | | | | | | Remove resource collision deprecations
| * | Remove resource collision deprecationsLamont Granquist2019-05-072-56/+11
| | | | | | | | | | | | | | | | | | | | | Switch to only doing warnings. Remove the features in the node_map that we never used. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* | | Merge pull request #8307 from ↵Tim Smith2019-05-0711-183/+310
|\ \ \ | | | | | | | | | | | | | | | | MsysTechnologiesllc/Kapil/MSYS-986_Move_response_file_and_response_file_variables_out_of_base_package_resource package: move response_file and response_file_variables out of base package resource
| * | | Move response_file and response_file_variables out of base package resourceKapil Chouhan2019-05-0711-183/+310
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Kapil Chouhan <kapil.chouhan@msystechnologies.com> Fix for Move response_file and response_file_variables out of base package resource Signed-off-by: Kapil Chouhan <kapil.chouhan@msystechnologies.com> update require changes Signed-off-by: Kapil Chouhan <kapil.chouhan@msystechnologies.com> Updated require changes Signed-off-by: Kapil Chouhan <kapil.chouhan@msystechnologies.com> Fixed some unit test cases Signed-off-by: Kapil Chouhan <kapil.chouhan@msystechnologies.com>
* | | | Remove purposefully failing test - no longer want to gate releasestyler-ball2019-05-071-4/+0
| | | | | | | | | | | | | | | | Signed-off-by: tyler-ball <tball@chef.io>
* | | | Fix the client create specsadminTim Smith2019-05-071-18/+1
| |/ / |/| | | | | | | | | | | | | | While I'm in here fix the validator default check Signed-off-by: Tim Smith <tsmith@chef.io>
* | | Merge pull request #7758 from chef/btm/target-modeTim Smith2019-05-062-3/+116
|\ \ \ | | | | | | | | Initial target_mode implementation
| * | | Feedback from Ryan DavisBryan McLellan2019-05-061-2/+2
| | | | | | | | | | | | | | | | Signed-off-by: Bryan McLellan <btm@loftninjas.org>
| * | | Unit tests for experimental target modeBryan McLellan2019-05-062-0/+113
| | | | | | | | | | | | | | | | Signed-off-by: Bryan McLellan <btm@chef.io>
| * | | Target Mode initial implementationBryan McLellan2019-05-061-3/+3
| | | | | | | | | | | | | | | | Signed-off-by: Bryan McLellan <btm@chef.io>
* | | | Merge pull request #8354 from chef/license_acceptanceTyler Ball2019-05-064-5/+25
|\ \ \ \ | |/ / / |/| | | Add logic to require acceptannce of the Chef license to run the client
| * | | Purposefully adding a failing test to prevent Chef Infra from promoting ↵license_acceptancetyler-ball2019-05-031-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | unstable -> current Signed-off-by: tyler-ball <tball@chef.io>
| * | | Fix 2 minute pause while we wait for license acceptance cli to time outMark Anderson2019-05-031-0/+6
| | | | | | | | | | | | | | | | Signed-off-by: Mark Anderson <mark@chef.io>
| * | | Adding license acceptance support to 'knife bootstrap'tyler-ball2019-05-031-5/+7
| | | | | | | | | | | | | | | | Signed-off-by: tyler-ball <tball@chef.io>
| * | | Use keyword arguments for acceptanceMark Anderson2019-05-031-1/+1
| | | | | | | | | | | | | | | | Signed-off-by: Mark Anderson <mark@chef.io>
| * | | knife bootstrap is only knife command to have license acceptance flowtyler-ball2019-05-033-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because in order to run `chef-client` on the bootstrapped node the user needs to have accepted the licenses locally. Right now we have commented out this code because we will enforce it in a different PR. Signed-off-by: tyler-ball <tball@chef.io>
| * | | Read license-acceptance from chef config (knife.rb, client.rb)tyler-ball2019-05-031-18/+0
| | | | | | | | | | | | | | | | Signed-off-by: tyler-ball <tball@chef.io>
| * | | Adding in the license-acceptance flowtyler-ball2019-05-033-5/+27
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | This adds a new feature to chef-client where users must accept the EULA before using the product. Users can accept the license by passing '--chef-license accept', setting ENV[CHEF_LICENSE]=accept or by running 'chef-client' and following the interactive prompt. Signed-off-by: tyler-ball <tball@chef.io>
* | | Merge pull request #8442 from chef/mp/bootstrap/restore-prereleaseBryan McLellan2019-05-064-57/+54
|\ \ \ | | | | | | | | Restore bootstrap pre-release support
| * | | Pass channel directly into the script/url to determine Chef Infra downloadmp/bootstrap/restore-prereleaseMarc A. Paradise2019-05-032-75/+37
| | | | | | | | | | | | | | | | Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
| * | | `prerelease` -> `channel` in bootstrap contextsMarc A. Paradise2019-05-033-32/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Updates BootstrapContext and WindowsBootstrapContext to expect a 'channel' config value instead of a 'prelease' value. This removes the old behavior of inferring pre-release (current) from the presence of a fourth version number in the version string (eg 1.2.3.pre) - that was specific to gem installs, and gem installs are not used in bootstrap. Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
| * | | Change 'prerelease' to 'channel'.Marc A. Paradise2019-05-031-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds support for deprecating a boolean flag into a non-boolean value, and uses it to make `--prerelease` deprecated in favor of `--channel current`. By default, `channel` is `stable`. Separately, all deprecated options are now configured to display at the end of the options list, instead of mixed into the non-deprecated list. Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
| * | | Make config_source aware of cli defaultsMarc A. Paradise2019-05-031-16/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a value comes from CLI defaults, it will now return :cli_default. This supports verifying deprecations when we need to know if a value was actually supplied from the CLI, or if it was defaulted from CLI options. Since we have all of the original sources still available, this also makes it so that we don't keep a separate hash for tracking config source - we're just checking in the original config sources in order that matches merge priority. Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
| * | | Restore bootstrap pre-release supportMarc A. Paradise2019-05-032-1/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It was originally removed after discussion in community slack, but it turns out to have a little more utility than we thought. When enabled, it will cause the package to be downloaded from the `current` channel. Option description has been updated from 'install prerelease gem' to 'install from current channel'. This commit otherwise restores the original behavior and adds some tests. Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
* | | | Merge pull request #8455 from chef/btm/MSYS-979Tim Smith2019-05-061-20/+123
|\ \ \ \ | |_|/ / |/| | | Fix for cron resource get confused by environment/property mismatch
| * | | - Added a warning in case user is using a `environment` for an entry that ↵btm/MSYS-979vijaymmali19902019-05-031-20/+123
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | can also be specified as a `property` - Added unit test cases - Ensured chefstyle - Added a warning in case user is using a `environment` for an entry that can also be specified as a `property` - Revert changes in order to pass chefstyle - Added a warning in case user is using a `environment` for an entry that can also be specified as a `property` - Added these changes in cron_different? method - Added unit test cases - Added some changes in cron.rb - It now throws error if user passes both environment with the {:SHELL, :HOME, :PATH, :MAILTO} and these properties itself. - It maintains idempotency. - Added Rspecs for this case. - Ensured chef-style. Signed-off-by: vijaymmali1990 <vijay.mali@msystechnologies.com>
* | | Merge pull request #8456 from chef/lcg/parse-only-rb-filesTim Smith2019-05-037-1/+15
|\ \ \ | |/ / |/| | Chef-15: cookbook compiler should parse only .rb files
| * | Chef-15: cookbook compiler should parse only .rb fileslcg/parse-only-rb-filesLamont Granquist2019-05-037-1/+15
| | | | | | | | | | | | | | | | | | | | | Fixes #6281 which is a frequently reported issue where md files and swap files and other junk causes the cookbook compiler to barf. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* | | Update specs for the new messagesTim Smith2019-05-023-3/+3
| | | | | | | | | | | | Signed-off-by: Tim Smith <tsmith@chef.io>
* | | Merge pull request #8440 from chef/CHEF-8432/fix-default-protocolBryan McLellan2019-05-022-14/+79
|\ \ \ | | | | | | | | [CHEF-8432] Ensure default protocol is used properly. Use correct 'require' before accessing Net::SSH constants.
| * | | Require 'net/ssh' before we reference it.Marc A. Paradise2019-05-021-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This also updates bootstrap to provide `non_interactive` as an option to TrainConnector, instead of TrainConnector setting it behind the scenes. Bootstrap uses non-interactive to ensure that we don't get net/ssh prompts for password in case of password failure. Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>