summaryrefslogtreecommitdiff
path: root/lib/chef/knife.rb
Commit message (Collapse)AuthorAgeFilesLines
* Add support for knife commands with hyphens.Noah Kantrowitz2018-07-101-2/+6
| | | | | | This works exactly like with an underscore, but is a bit more user-friendly sometimes (e.g. `get_config` vs `get-config`). Signed-off-by: Noah Kantrowitz <noah@coderanger.net>
* fix Style/MutableConstantLamont Granquist2018-07-021-1/+1
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* fix Style/PreferredHashMethodsLamont Granquist2018-07-021-4/+4
| | | | | | | absolutely hard requirement on the fixes that went into chef-config 2.2.11, so the floor of that gem is bumped up. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Assume ChefDK in the messagingTim Smith2018-05-311-2/+1
| | | | Signed-off-by: Tim Smith <tsmith@chef.io>
* Avoid some unnecessary complexityofficial_knife_pluginsTim Smith2018-05-301-3/+3
| | | | | | We already know the plugin name so there's no need to use find in order to return the plugin name. Signed-off-by: Tim Smith <tsmith@chef.io>
* Better errors with uninstalled official knife pluginsTim Smith2018-05-301-3/+1
| | | | | | | | Remove the mention of Chef .10 Remove terremark and bluebox Add more modern plugins Signed-off-by: Tim Smith <tsmith@chef.io>
* Fix up knife loggingtm/investigate_loggingThom May2018-04-111-3/+5
| | | | | | | ensure that trace level is selectable if necessary via -VVV Pass the correct object to net/ssh Signed-off-by: Thom May <thom@chef.io>
* Revert "Knife should give a useful error when the chef_server_url isn't a ↵revert-6253-feat/5556Thom May2018-03-141-2/+0
| | | | chef server API"
* Merge pull request #6253 from jeunito/feat/5556Tim Smith2018-03-121-0/+2
|\ | | | | Knife should give a useful error when the chef_server_url isn't a chef server API
| * change messagingJose Asuncion2017-07-041-1/+1
| | | | | | | | Signed-off-by: Jose Asuncion <jeunito@gmail.com>
| * format NotAChefServerException nicelyJose Asuncion2017-07-041-0/+2
| | | | | | | | Signed-off-by: Jose Asuncion <jeunito@gmail.com>
* | Stop mixlib-cli default clobbering mixlib-config settingslcg/fix-default-precedenceLamont Granquist2018-02-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The pre-14 precedence level is: 1. mixlib-cli setting 2. mixlib-cli default 3. mixlib-config setting 4. mixlib-config default This means that if an option has a mixlib-cli default that it cannot ever be set in the config file. This PR swaps 2+3 around: 1. mixlib-cli setting 2. mixlib-config setting 3. mixlib-cli default 4. mixlib-config default Now the mixlib-cli defaults still take precedence over mixlib-config defaults, but it is possible to set a value in config.rb if there's a mixlib-cli default setting (which creeps into the settings in hidden ways if you just use `boolean: true` in mixlib-cli). Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* | Link to the knife.rb docs when the knife.rb file is missingknife_rbTim Smith2018-01-221-1/+1
| | | | | | | | | | | | This is a pretty common first error message to experience with Chef. Let's point the users to a helpful location so they can quickly get up and running. Add some YARD comments while I was in the config class Signed-off-by: Tim Smith <tsmith@chef.io>
* | Merge pull request #6660 from chef/tm/credentialsThom May2017-12-181-2/+3
|\ \ | | | | | | implement credential management
| * | Specify a profile on the command lineThom May2017-12-181-2/+3
| |/ | | | | | | Signed-off-by: Thom May <thom@chef.io>
* | Cleanup some YARD warningsyard2Tim Smith2017-12-131-13/+13
|/ | | | Signed-off-by: Tim Smith <tsmith@chef.io>
* Checking for proxy error separatelynimisha2017-06-021-2/+5
| | | | Signed-off-by: nimisha <nimisha.sharad@msystechnologies.com>
* Mofified error message to explain connectivity issue due to Proxy settingsnimisha2017-05-111-1/+2
| | | | Signed-off-by: nimisha <nimisha.sharad@msystechnologies.com>
* clean up one more CustomManifestLoader stray referencelcg/deprecated-knife-subcommand-apisLamont Granquist2017-04-021-3/+2
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* fix specs: RedundantReturn, RedundantSelf, RedundantBeginLamont Granquist2017-02-131-4/+4
| | | | | | department of redundancy department Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Style/NumericPredicate comparison stylelcg/numericpredicateLamont Granquist2016-12-211-1/+1
| | | | | | | | | | | | | Apparently rubocop thinks the default behavior should be that we have to rewrite every use of `foo == 0` into `foo.zero?` which is a big pile of NOPE for me. After discovering that `.zero?` is actually slower, I'd prefer to go the other direction. Same for `positive?` and `negative?`. These are the only uses of `zero?` in the chef/chef codebase, while I'm pretty sure the inverse rule would touch nearly every file. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Merge pull request #5463 from chef/tm/last_json_deprecationsThom May2016-10-191-1/+5
|\ | | | | [Knife] Fix deprecation warning when creating data bag items
| * Return a raw hash when creating objectstm/last_json_deprecationsThom May2016-10-181-1/+5
| | | | | | | | | | | | Fixes chef/chef-vault#215 Signed-off-by: Thom May <thom@may.lt>
* | Implement `--config-option` CLI opt for knifedan/config-option-in-knifedanielsdeleo2016-10-181-1/+15
|/ | | | | | | | | | | The `--config-option` CLI option allows setting any `Chef::Config` setting on the command line, which allows applications to be used without a configuration file even if a desired config option does not have a corresponding CLI option. This CLI option was present in the help output for knife but was not actually implemented. Moving the behavior into chef-config allows us to use it for both `chef-client` and `knife`. Signed-off-by: Daniel DeLeo <dan@chef.io>
* fix knife list_commands()lcg/fix-knife-list-commandsLamont Granquist2016-09-271-15/+14
| | | | | | this was not supposed to be private Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* also add a big comment to the Chef::Knife codeLamont Granquist2016-09-071-0/+6
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* readability improvements to options parsing codelcg/knife-options-readabilityLamont Granquist2016-09-061-20/+18
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* fix private methods that weren't privateLamont Granquist2016-08-181-37/+46
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* fix Style/BlockDelimiters, Style/MultilineBlockLayout and 0.42.0 engine upgradeLamont Granquist2016-08-171-4/+0
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* update to latest chefstyle - fix casecmptm/fix_casecmpThom May2016-04-201-1/+1
|
* chefstyle Style/AndOr fixesLamont Granquist2016-03-141-1/+1
| | | | | this is part of our informal style guide, lets make it formal since clearly its not getting followed very well.
* Merge pull request #4617 from chef/lcg/chefstyle-perfLamont Granquist2016-03-041-4/+6
|\ | | | | Autofixing new Perf cops in 0.37.2
| * add some @yield docsLamont Granquist2016-03-041-0/+2
| | | | | | | | added some FIXMEs because trying to sort out types for random undocumented code was making me completely aggro
| * remove unused block argumentslcg/chefstyle-perfLamont Granquist2016-02-231-2/+2
| |
| * Autofixing new Perf cops in 0.37.2Lamont Granquist2016-02-231-2/+2
| | | | | | | | | | | | | | | | | | | | 6 Performance/Casecmp 18 Performance/Detect 1 Performance/RangeInclude 27 Performance/RedundantBlockCall 6 Performance/RedundantMatch 5 Performance/RedundantMerge 18 Performance/StringReplacement
* | First part of fixing the rehash command, it now always loads gems from disc ↵tyler-ball2016-03-041-0/+5
|/ | | | instead of using the hash file
* Be way more explicit about how we're handling datatm/missed_migrationThom May2016-02-151-2/+2
| | | | | | | This just codifies the behaviour we're actually using - that we're passing a json string and expecting a hash back. Also adds a deprecation warning to the use of Chef::JSONCompat.from_json
* convert MultilineOperationIndentation style to "indented"Lamont Granquist2016-02-121-1/+1
| | | | this looks nicer.
* autofixing whitespace copsLamont Granquist2016-02-051-7/+7
| | | | | | | | | | | | | | | | | | | | | | 4174 Style/SpaceInsideHashLiteralBraces 1860 Style/SpaceAroundOperators 1336 Style/SpaceInsideBlockBraces 1292 Style/AlignHash 997 Style/SpaceAfterComma 860 Style/SpaceAroundEqualsInParameterDefault 310 Style/EmptyLines 294 Style/IndentationConsistency 267 Style/TrailingWhitespace 238 Style/ExtraSpacing 212 Style/SpaceBeforeBlockBraces 166 Style/MultilineOperationIndentation 144 Style/TrailingBlankLines 120 Style/EmptyLineBetweenDefs 101 Style/IndentationWidth 82 Style/SpaceAroundBlockParameters 40 Style/EmptyLinesAroundMethodBody 29 Style/EmptyLinesAroundAccessModifier 1 Style/RescueEnsureAlignment
* Merge pull request #4481 from chef/jdm/fips-58Jay Mundrawala2016-02-031-1/+7
|\ | | | | Allow use of command line fips switch for knife
| * Allow use of command line fips switch for knifeJay Mundrawala2016-01-281-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | This somewhat worked before. However, it was just for knife bootstrap. It also didn't support --no-fips in the case where it was in your knife.rb and you decided that you didn't want to use fips for that one call. The assumption here is fips mode you run knife with is the fips mode the node will get. This has the nice property that validatorless bootstraps will talk to the chef server in fips mode if the node is requested to be in fips mode.
* | Update all auth email address from opscode.com and getchef.com to chef.io.Noah Kantrowitz2016-02-021-2/+2
| | | | | | Generated via git ls-files | xargs perl -pi -e "s/(Author.*?<[^@]+@)(?:opscode\\.com|getchef\\.com)(>)/\\1chef.io\\2/gi"
* | Replace all Opscode copyrights with Chef Software.Noah Kantrowitz2016-02-021-1/+1
| | | | | | Created via git ls-files | xargs perl -pi -e "s/(Copyright.*?), Opscode(,)? Inc(\.)?/\\1, Chef Software Inc./gi"
* | Copyright year update for 2016 and massive cleanup.Noah Kantrowitz2016-02-021-1/+1
|/ | | Generated via git ls-files | xargs perl -pi -e "s/[Cc]opyright (?:\([Cc]\) )?((?\!$(date +%Y))\\d{4})(-\\d{4})?([, ][ \d]+)*(,|(?= ))/Copyright \\1-$(date +%Y),/g"
* Do openssl initialization from applicationsJay Mundrawala2016-01-251-0/+1
| | | | | | | | | | | | | | | | | | | Some notes: * Add module overrides for fips We need to use the SHA1 module under OpenSSL because the openssl functions called by Digest::SHA1 cause openssl to crash the process. We use the Digest::MD5 over the OpenSSL::MD5 module because md5 is not allowed when in fips mode and causes the process to crash. While we work through these issues, we're going to allow it to pass by compiling the ruby md5 implementation. * Use OpenSSL::Digest::SHA256 instead of Digest::SHA256 Digest::SHA256 is broken in fips mode because it uses unapproved APIs. They cause the process to terminate.
* Autofixing Style/PercentLiteralDelimeterslcg/percentliteraldelimetersLamont Granquist2016-01-181-1/+1
| | | | | | See chef/chefstyle#11 for analysis and discussion. We select '{}' since audit of our source code shows that is the most common, and that used to be the dominant learning paradigm (e.g. in ruby 1.9 pickaxe book.
* Use double quotes by defaultThom May2016-01-141-26/+26
| | | | | | | This is an entirely mechanically generated (chefstyle -a) change, to go along with chef/chefstyle#5 . We should pick something and use it consistently, and my opinion is that double quotes are the appropriate thing.
* Convert all uses of Chef::REST to Chef::ServerAPItm/no_more_restThom May2016-01-111-6/+8
| | | | | | | In the process, stop auto-expanding JSON in the HTTP client, and let individual classes control that themselves. Fixes #2737, Fixes #3518
* Merge pull request #4273 from chef/jdm/default-auth-1.1Jay Mundrawala2015-12-111-6/+0
|\ | | | | Use signing protocol 1.1 by default
| * Use signing protocol 1.1 by defaultjdm/default-auth-1.1Jay Mundrawala2015-12-101-6/+0
| | | | | | | | | | | | | | | | | | | | | | All supported Chef servers support the 1.1 signing protocol. There is no reason to continue using 1.0, and removing it as the default allows us to remove a bunch of code that tries to upgrade 1.0 to 1.1 when the node name is too long. If the user specifies 1.0 as the auth protocol version from this point on, they will have to guarantee that the node name is not too long.