| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
In the process, stop auto-expanding JSON in the HTTP client, and let
individual classes control that themselves.
Fixes #2737, Fixes #3518
|
|\
| |
| | |
Use signing protocol 1.1 by default
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
|/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
| |
message when using a plugin manifest.
|
|
|
|
|
|
| |
`knife rehash` stores the paths to knife plugins in a specially
formatted plugin_manifest entry. This lowers the overhead of
subsequent knife invocations.
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
| |
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.
|
|\
| |
| | |
Update knife missing gem message for ChefDK
|
| | |
|
|/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Fixes CHEF-4711
|
| |
|
|
|
|
| |
Also the associated test is removed as I am not sure how it should be fixed.
|
| |
|
| |
|
|
|
|
|
| |
* Uses Chef::HTTP::Simple rather than Chef::REST to fetch files
* Re-use error handling logic in ConfigFetcher
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
| |
configuring
|
| |
|
|
|
|
|
|
| |
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.
|
|
The opscode/chef repository now only contains the core Chef library code
used by chef-client, knife and chef-solo!
|