summaryrefslogtreecommitdiff
path: root/lib/chef/knife.rb
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* 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
| * update knife missing gem message for chefdkTroy Ready2015-01-151-1/+2
| |
* | Fix typo cab to candrag00n2015-01-111-1/+1
|/
* Add specific error messaging for SSL errors to knifedanielsdeleo2014-12-151-0/+7
| | | | | | | | | | | | | | Knife now gives an error message like this when an SSL error occurs: ``` ERROR: Could not establish a secure connection to the server. Use `knife ssl check` to troubleshoot your SSL configuration. If your Chef Server uses a self-signed certificate, you can use `knife ssl fetch` to make knife trust the server's certificates. Original Exception: OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed ```
* Fix knife plugin path searchingLamont Granquist2014-12-031-3/+11
| | | | | | | | | | | | | | | | | | Unreleased Chef 12.0.0 bug caught in testing where only the searching upwards from PWD to find .chef in order to get the plugin path for knife was busted. The chef_config_dir was being used before load_config was being called, so it was nil, which broke finding knife plugins. This was fixed by adding some lazy initialization of the config_loader object itself and the chef_config_dir. The reset_config_loader! is added entirely to reset the global state for unit testing. This whole class is a bit horrible and needs to have all its global state removed from it, class methods removed, class ivars and the class-variable-in-a-class-method-for-inheritance-lolwut needs to be removed. Unfortunately, that requires some delicate surgery because Chef::Knife gets used as a public API, and is beyond the scope of gettting Chef 12 shipped.
* typo fixes - https://github.com/vlajos/misspell_fixerVeres Lajos2014-11-081-1/+1
|
* print the path to the configuration file usedAlex Pop2014-10-041-1/+2
|
* Add debug/info logging for knife config file findingdanielsdeleo2014-09-031-1/+13
| | | | | | | To resolve a chicken/egg issue with the logger being configured *after* the config is located and read, knife will now check for a KNIFE_DEBUG variable and initialize the logger to debug early in the startup process when that variable is set.
* Extract Knife config file find/load to a reusable componentdanielsdeleo2014-09-031-121/+24
|
* Refactor caller decorations into with_server_connectivityJohn Keiser2014-07-071-4/+1
|
* Move local-mode server connectivity code to Chef::LocalModeJohn Keiser2014-07-071-3/+3
|
* making the chef-zero host configurable for knife and chef-clientLuke Amdor2014-06-051-0/+1
|
* Add SSL check and certificate fetching commands to knifedanielsdeleo2014-03-191-0/+1
| | | | Fixes CHEF-4711
* remove debugging putsLamont Granquist2013-12-131-1/+0
|
* Check for ENV['CD'] instead of ENV['PWD'] on windows.sersut2013-11-051-1/+8
| | | | Also the associated test is removed as I am not sure how it should be fixed.
* Fixup specs to handle config jail featuredanielsdeleo2013-10-161-1/+5
|
* Flip config_missing? to return true when missingJohn Keiser2013-10-161-1/+1
|
* Load client/solo config via ConfigFetcherdanielsdeleo2013-10-161-17/+19
| | | | | * Uses Chef::HTTP::Simple rather than Chef::REST to fetch files * Re-use error handling logic in ConfigFetcher
* Add --config-file-jail to avoid loading user knife.rb in testsJohn Keiser2013-10-151-4/+8
|
* Pick up knife config instead of /etc/chef/client.rb if local mode is specifiedJohn Keiser2013-10-091-6/+7
|
* Make --local-mode option so that local user can run local recipesJohn Keiser2013-10-091-1/+4
|
* Add -z and --chef-zero-port options to knife and chef-clientJohn Keiser2013-10-021-0/+3
|
* Add tests for start_chef_zero parameter in knifeJohn Keiser2013-10-021-5/+8
|
* Support start_chef_zero parameter in knife and chef-clientJohn Keiser2013-10-021-0/+2
|
* sorting subcommands, this will display all subcommands in the order a..zSander Botman2013-05-301-1/+1
|
* [CHEF-3932] Support multiple calls of `Knife.deps`Teemu Matilainen2013-04-111-2/+8
| | | | | | If a Knife subcommand class were inheriting or including other classes with lazy loading dependencies, a later call to `Knife.deps` overwrote the earlier block. Fix it by collecting the blocks to an array.
* [CHEF-2682] raise exception on non-GET/HEAD redirectsLoic ANTOINE-GOMBEAUD2013-03-061-0/+3
|
* [CHEF-3497] apply config in the desired orderdanielsdeleo2013-01-141-29/+52
| | | | | | | | | Takes advantage of new mixlib-cli option to keep default values from the mixlib-cli DSL separate from user-supplied values. Config settings are merged: 1. Defaults from mixlib-cli DSL 2. Settings from Chef::Config[:knife] 3. Values from CLI options
* [CHEF-3497] don't configure in Knife#initializedanielsdeleo2013-01-141-2/+2
| | | | | | Config changes a ton of global state and is based on the state of the machine it runs on (most importantly, the user's config file). Running configure_chef in the initializer makes unit tests extremely fragile
* Update stubbing order within config specChris Roberts2013-01-141-1/+1
|
* Isolate knife config file location methodology. Use new locate method when ↵Chris Roberts2013-01-111-27/+38
| | | | configuring
* Allow knife.rb configuration file to provide any options for knife pluginsChris Roberts2013-01-111-1/+10
|
* [CHEF-3663] Search for .chef in ENV[PWD] if setdanielsdeleo2012-12-051-2/+11
| | | | | | Prefer ENV["PWD"] for current working dir, but fall back to Dir.pwd if not set. Fixes config path searching when part of the path hierarchy is a symlinked directory.
* [OC-3564] move core Chef to the repo root \o/ \m/Seth Chisamore2012-10-301-0/+537
The opscode/chef repository now only contains the core Chef library code used by chef-client, knife and chef-solo!