summaryrefslogtreecommitdiff
path: root/lib/chef/knife.rb
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* | Moving the proxy export to environment varibles into Chef::Configtyler-ball2015-12-091-0/+1
|/
* Avoid squashing/humanizing the exception when config[:verbosity] == 2btm/knife-backtraceBryan McLellan2015-11-061-1/+1
| | | | | | | | | | | | | | | | | We create an instance of Chef::Knife::Bootstrap in knife-ec2, but we've already processed ARGV so we substitute and process an empty argv. config[:verbosity] comes from Chef::Application::Knife. Normally we merge those options with the ones from the knife subcommand in Chef::Knife.run. Since we don't in this case, we don't set it to the default of 0 that is specified there, leaving it nil. We set Chef::Config[:verbosity] to config[:verbosity] in Chef::Knife#initialize which now becomes nil. This change makes it so we do not update Chef::Config[:verbosity] if config[:verbosity] is nil, so that later when we rescue we don't call humanize_exception if Chef::Config[:verbosity] is 2.
* Improve detection of ChefFS-based commands in `knife rehash`ssd/rehash-cheffsSteven Danna2015-10-291-1/+14
| | | | | | | | | | | | ChefFS-based commands have a superclass (Chef::ChefFS::Knife) which defines its own inherited method that calls super. This breaks our detection of where the subcommand is defined since the file with the definition is no longer at the top of the call stack. This commit special-cases subclasses with a superclass of Chef::ChefFS::Knife to account for this. Fixes #4089
* Be explicit about 'knife rehash' in subcommand_not_foundAlex Pop2015-08-251-1/+1
|
* Make subcommand_not_found message loader-specific to give more helpful error ↵Alex Pop2015-08-251-1/+7
| | | | message when using a plugin manifest.
* Add knife-rehash command for subcommand location hashingSteven Danna2015-08-251-54/+28
| | | | | | `knife rehash` stores the paths to knife plugins in a specially formatted plugin_manifest entry. This lowers the overhead of subsequent knife invocations.
* Added versioned Chef Object API support code and repaired Chef::User.create.tylercloke2015-06-051-4/+16
| | | | Also added Chef::User.create V1 API support. Chef::User.create will attempt to use V1 of the server API, and if it fails, it will fall back to V0.
* change default log_location + log_level for knifeLamont Granquist2015-05-151-1/+3
| | | | | | | | | send logging to STDERR and drop default log_level to :warn so that we can see warnings again. logging needs to go to STDERR so that we don't break someone's 'API' where they're piping stdin to some filter. we believe the log_level was not warn in order to suppress warns off of 404s which no longer warn by default now.
* Nice error formatting for unsupported API version in Knife.tylercloke2015-05-041-0/+8
|
* Add --no-listen option to disable zero binding to portdanielsdeleo2015-04-011-0/+3
|
* Add Knife::Core::UI#edit_hashSteven Danna2015-02-091-0/+1
| | | | | | edit_hash is similar to edit_data except that it returns an uninflated hash. edit_data returns either a string/IO, a hash, or a full ruby object, making it difficult to work with.
* Merge pull request #2760 from troyready/msng_plug_msgLamont Granquist2015-01-281-1/+2
|\ | | | | Update knife missing gem message for ChefDK