summaryrefslogtreecommitdiff
path: root/spec/unit/knife
Commit message (Collapse)AuthorAgeFilesLines
* Avoid ambiguous regexesambiguous_regexTim Smith2020-11-2113-34/+34
| | | | | | Just makes it a bit easier to read. Signed-off-by: Tim Smith <tsmith@chef.io>
* Simplify regexes by removing extra character classesTim Smith2020-10-301-3/+3
| | | | | | We're working too hard here. No need for these. Signed-off-by: Tim Smith <tsmith@chef.io>
* Use __dir__ instead of getting the dir of __FILE__Tim Smith2020-09-091-6/+6
| | | | | | This is a bit easier to read Signed-off-by: Tim Smith <tsmith@chef.io>
* Merge pull request #9482 from MsysTechnologiesllc/dh/Fix-knife-ssh-hang-win2k16Tim Smith2020-08-211-2/+2
|\ | | | | Avoid knife ssh freeze on windows
| * fix specsdheerajd-msys2020-08-191-2/+2
| | | | | | | | Signed-off-by: dheerajd-msys <dheeraj.dubey@msystechnologies.com>
* | Add unit and integration testing back to omnibus testersLamont Granquist2020-08-171-0/+1
|/ | | | | | It is slow but it does catch real bugs Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* fix to render file_cache_path more "windows-native"Lamont Granquist2020-08-171-3/+3
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* fix crazy formattinglcg/fix-bootstrapping-path-issuesLamont Granquist2020-08-141-7/+11
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* fix the real issueLamont Granquist2020-08-141-7/+12
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Fix bootstrapping windows-from-linuxLamont Granquist2020-08-141-2/+2
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* File.exists? -> File.exist?existTim Smith2020-08-125-23/+23
| | | | | | Update some of these methods Signed-off-by: Tim Smith <tsmith@chef.io>
* Remove global state from cookbook uploader.fix-cookbook-uploader-global-statePete Higgins2020-07-211-3/+1
| | | | Signed-off-by: Pete Higgins <pete@peterhiggins.org>
* Remove unused codeVivek Singh2020-07-211-1/+0
| | | | Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
* Fix test casesVivek Singh2020-07-211-5/+2
| | | | Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
* The spec/ directory is in the path.fix-spec_helper-requiresPete Higgins2020-07-131-1/+1
| | | | Signed-off-by: Pete Higgins <pete@peterhiggins.org>
* Fix knife cookbook upload tests.snehaldwivedi2020-07-101-6/+5
| | | | Signed-off-by: Pete Higgins <pete@peterhiggins.org>
* Fix some odd whitespacing in tests.Pete Higgins2020-06-243-9/+9
| | | | Signed-off-by: Pete Higgins <pete@peterhiggins.org>
* Fix more typosTim Smith2020-06-231-1/+0
| | | | Signed-off-by: Tim Smith <tsmith@chef.io>
* More aggressively deprecate config_valueLamont Granquist2020-06-221-0/+1
| | | | | | | | | | | | | | | Force subclasses to use the `config` hash directly. This should not affect any knife plugins shipping in chef-workstation since the calls to config_value have already been removed from all of those plugins. The multiple-argument version of config_value was not actually used anywhere in those plugins and the single value version was removed and replaced with accessing the config hash. Since that was introduced sometime in 15.x when the bootstrap changes went in, it is not expected that many external knife plugins have picked up the usage of config_value. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Warn during bootstrapping when using validation keyswarn_on_validator_bootstrapTim Smith2020-06-091-2/+2
| | | | | | | | | | | | | We should highly encourage users to move to validatorless bootstrapping 1) It's more secure 2) It requires less admin work since there no validation key to pass around or rotate This also provides an improved message helping the user to move off the old keys and fixes some bad formatting where the 2nd line was indented about 40 columns. Signed-off-by: Tim Smith <tsmith@chef.io>
* Get lib/ free of spelling violations.Pete Higgins2020-05-181-1/+1
| | | | Signed-off-by: Pete Higgins <pete@peterhiggins.org>
* fix windows bootstrap; replicate https://github.com/chef/chef/pull/9839 by ↵Marc Chamberland2020-05-161-0/+6
| | | | | | | | | Chad Jessup This fixes bootstrapping on Windows. All credit goes to Chad Jessup <chad.jessup@gmail.com> but since the original PR was left without DCO I'm replicating it here, with valid DCO. Signed-off-by: Marc Chamberland <chamberland.marc@gmail.com>
* Align all our comments with the codeTim Smith2020-05-0610-44/+44
| | | | | | Autocorrected with chefstyle after enabling that cop. It was very hard to read some complex autocorrected blocks w/o this. Signed-off-by: Tim Smith <tsmith@chef.io>
* Knife bootstrap options cleanupLamont Granquist2020-04-177-297/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have issue that are caused by old code before merging of hash values were done correctly. The `config` hash correctly merges all options and should always be used. Knife plugins should never touch Chef::Config[:knife] values (either reading or writing from them). The `knife_config` should be converted to the `config` hash since it directly accesses Chef::Config[:knife] values. The `config_value()` helper should no longer be used. Very clearly most people started to use that when they should just use the config hash directly. That was intended to be used only when a knife cli option was being renamed and the former configuration value needed to be used as well. It has been cargo culted around as the way to access config values, and that should really stop. The DataBagSecretOption mixin has been cleaned up so that the cli options read+write only to the config[:cl_secret] and config[:cl_secret_file] values. The config file values go into config[:secret] and config[:secret_file]. The fact that those are the merged values in the `config` hash doesn't matter since only the cli should be writing to the first two and only the config file should be writing to the latter two. I don't know why it was made so complicated to begin with, but if there's some hidden chef-11.early backcompat there, then chef-16 deliberately breaks that. The use of `locate_config_value` helpers in all knife plugins is also discouraged (but they all implement those themselves), just use the config hash, which has the correct hash merge ordering. All of those need to be deleted. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Remove copyright dateslcg/remove-copyright-datesLamont Granquist2020-04-1378-79/+79
| | | | | | | | Legally incredibly dubious, particularly since we don't follow it strictly as policy, and we have git history instead, which does it right. This is just a waste of time and a cargo cult. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* fix speclcg/fix-bootstrap-cli-optionsLamont Granquist2020-04-081-2/+2
| | | | | | | the bootstrap context isn't responsible for merging so this was always testing the wrong behavior Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* some spec typosVivek Singh2020-04-073-3/+3
| | | | Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
* Implement eager_load_libraries metadata optionLamont Granquist2020-04-031-1/+2
| | | | | | | | This implements RFC-40 from the old chef rfc repo: https://github.com/chef-boneyard/chef-rfc/blob/master/rfc040-on-demand-cookbook-libraries.md Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Replace highline.color with pastel.decorateBryan McLellan2020-03-021-0/+16
| | | | | | | | | | Contributes to the removal of the 'heavy' highline dependency (#9359) by switching from highline.color to pastel.decorate, which is a drop-in replacement. Pastel is part of the tty[1] family of libraries. [1] https://github.com/piotrmurach/tty#3-components Signed-off-by: Bryan McLellan <btm@loftninjas.org>
* Merge pull request #9156 from MsysTechnologiesllc/ash/Fix_no_runlist_issueTim Smith2020-02-241-1/+1
|\ | | | | When bootstrapping don't send an empty run_list if we are using policyfiles instead
| * Optimize by using Mash as per review commentsNAshwini2020-02-121-1/+1
| | | | | | | | Signed-off-by: NAshwini <ashwini.nehate@msystechnologies.com>
* | Merge pull request #9371 from cinc-project/dist_bootstrapTim Smith2020-02-241-3/+3
|\ \ | | | | | | Add distro constants to the bootstrap templates to support non-Chef distros
| * | capitalize drive letterMarc Chamberland2020-02-041-3/+3
| | | | | | | | | | | | Signed-off-by: Marc Chamberland <chamberland.marc@gmail.com>
* | | Reflecting file_cache_path and file_backup_path value in_client.rbKapil chouhan2020-02-121-0/+14
| |/ |/| | | | | Signed-off-by: Kapil chouhan <kapil.chouhan@msystechnologies.com>
* | Update the spec for the new formatTim Smith2020-02-061-2/+2
|/ | | | Signed-off-by: Tim Smith <tsmith@chef.io>
* Update knife status --long to use cloud attributes not ec2 specific attributesstatus_done_rightTim Smith2020-01-281-2/+2
| | | | | | This way we get the public IP / hostname on Azure, GCE, DigitalOcean, Softlayer, etc. Signed-off-by: Tim Smith <tsmith@chef.io>
* Fix failing specsVivek Singh2020-01-241-1/+1
| | | | Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
* Added client side validation to validate presence of metadata files and ↵Vasu11052019-12-201-11/+72
| | | | | | validate name field Signed-off-by: Vasu1105 <vasundhara.jagdale@msystechnologies.com>
* Updated code to make sure temporary directory gets deleted after the uploadVasu11052019-12-181-1/+0
| | | | Signed-off-by: Vasu1105 <vasundhara.jagdale@msystechnologies.com>
* Fixed specs and chefstyle errorVasu11052019-12-161-3/+1
| | | | Signed-off-by: Vasu1105 <vasundhara.jagdale@msystechnologies.com>
* Updated knife cookbook upload and knife upload code to create temporary ↵Vasu11052019-12-161-17/+9
| | | | | | directory and copies all cookbooks into it and then generate metadata.json if it does not exist and load it to upload on Chef server Signed-off-by: Vasu1105 <vasundhara.jagdale@msystechnologies.com>
* Genrates metadata.json if not present and uploads it to chef server and ↵Vasu11052019-12-161-1/+12
| | | | | | deletes the local copy of it from chef repo Signed-off-by: Vasu1105 <vasundhara.jagdale@msystechnologies.com>
* Add chef-utils gem with various recipe DSL helpersLamont Granquist2019-11-087-10/+10
| | | | | | | | | | | | | This is the implementation of [RFC-087](https://github.com/chef-boneyard/chef-rfc/blob/master/rfc087-distro-sugar-helpers.md) although some of the specifics have been iterated on and changed. The documentation will be in the [README.md](https://github.com/chef/chef/tree/master/chef-utils/README.md) once this is merged. While this PR mostly moves chef-sugar utilities into core-chef via this chef-utils gem, the scope of the chef-utils gem should be considered larger than just that. As an example this PR moves the Mash class into this gem for reuse in ohai as well. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Updates for Chefstyle with Rubocop 0.75.1Tim Smith2019-11-041-1/+1
| | | | | | This update found a few things that should have been triggering before. Signed-off-by: Tim Smith <tsmith@chef.io>
* Fix knife cookbook metadata from file name argsVivek Singh2019-10-291-0/+7
| | | | Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
* Fix Exception: NoMethodError: undefined method join for nil:NilClassVivek Singh2019-10-271-17/+27
| | | | Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
* Fix license tag typoPhilippe Ombredanne2019-10-221-1/+1
| | | Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
* Add supermarket list & search specsVivek Singh2019-10-142-0/+155
| | | | Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
* Merge pull request #8856 from MsysTechnologiesllc/bootstrap_password_promptTim Smith2019-10-081-10/+46
|\ | | | | Fix Bootstrap password prompt
| * Fixed test-case for password prompt.Amol Shinde2019-09-111-2/+2
| | | | | | | | Signed-off-by: Amol Shinde <amol.shinde@msystechnologies.com>