| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- The doc formatter is now Chef::Config[:log_location]-aware
and will log to files as well
- There is now consistency where doc formatter output never
surprisingly changes to log formatter based on destination
- The "cli" log_location and the "config" log_location are now
treated separately, so a log_location in the client.rb will
always force output to a logfile, in addition to output
to STDOUT if necessary
- The logic around STDOUT is now simplified, if its open we
log to it, if its closed we don't, if you're daemonized we
assume you're capturing STDOUT via your process manager
- The log_location variables are now Arrays
Things not done:
- The cli can't specify an array, it would be nice to support
an accumulator pattern here. Would also need to support
disabling STDOUT logging though.
- Using the syslog or winevt logging devices requires the use
of the logger, which precludes using the formatter.
- Some people may want to have log-formatter style output
to the log file and doc formatter style output to STDOUT
which is not very possible right now. Right now we are
consistent in that you get either the logger both places
or the formatter both places. This use case is complicated
by the fact that they will want :info level logging for
the logger, but :warn level logging for the doc formatter
and that is another global.
- To do that latter thing right would probably require sending
log messages to the formatter, and supporting a different
log level in the formatter vs. the logger and then supporting
the STDOUT/cli loggging being the formatter, while the
log_location/config logging being the logger.
Those were way out of scope for what I could get done for Chef-16.
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
|
|\
| |
| |
| |
| | |
MsysTechnologiesllc/VSingh/fix-knife-download-environments
ChefFS & knife environment matching the output
|
| |
| |
| |
| | |
Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
|
| |
| |
| |
| |
| |
| | |
We added a deprecation warning to load_cookbooks and this is going to cause a ton of console spam for end users.
Signed-off-by: Tim Smith <tsmith@chef.io>
|
| |
| |
| |
| |
| |
| | |
validate name field
Signed-off-by: Vasu1105 <vasundhara.jagdale@msystechnologies.com>
|
| |
| |
| |
| | |
Signed-off-by: Vasu1105 <vasundhara.jagdale@msystechnologies.com>
|
| |
| |
| |
| | |
Signed-off-by: Vasu1105 <vasundhara.jagdale@msystechnologies.com>
|
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| | |
deletes the local copy of it from chef repo
Signed-off-by: Vasu1105 <vasundhara.jagdale@msystechnologies.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| | |
Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
|
| |
| |
| |
| | |
Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Fix cookbook syntax_check dir path error if cookbook_path is an array
Fix invalid error if cookbook_path set to nil or empty Array and TypeError: no implicit conversion of nil into String
Chefignore for each cookbooks/:cookbook
Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
|
|/
|
|
| |
Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
|
|
|
|
|
|
| |
enforce pretzels.
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
|
|
| |
since we use double quotes, be consistent everywhere.
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
|
|
| |
convert kind_of? to is_a?
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
| |
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
|
|
|
|
| |
Layout/MultilineMethodCallIndentation:
Enabled: true
EnforcedStyle: indented
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
|
|
| |
start enforcing using %i{} instead of arrays of symbols
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
|
|
|
| |
i like this one, gives visual priority to returns or raises that are
buried in the middle of things.
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
|
|
|
|
|
| |
Stops the kernel from scanning through all the activated gems every time in order
to resolve names into pathnames.
See rubygems/rubygems#2762
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
| |
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
|
|
|
| |
This gives a speed boost since rubygems does not have to scan through
every gem in the gemset in order to find the file.
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
|
|
| |
- Create directory recursively instead to assume that parent dir should exist.
Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
|
|
|
|
|
|
|
| |
this is the result of changes to rules we already previously had
enabled.
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
|
|
| |
includes backcompat for 2.5
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
| |
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
| |
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
| |
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
| |
Signed-off-by: Thom May <thom@chef.io>
|
|
|
|
| |
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
|
|
|
|
|
| |
This implements RFC 67, which removes cookbook segments, and moves to a
single list of all the files contained in a cookbook. This allows us to
move forward with better audit modes and also proper shipping of ohai
plugins.
Signed-off-by: Thom May <thom@chef.io>
|
|
|
|
| |
Signed-off-by: Jeremy J. Miller <jm@chef.io>
|
|
|
|
| |
Signed-off-by: Jeremy J. Miller <jm@chef.io>
|
|
|
|
| |
Signed-off-by: Jeremy J. Miller <jm@chef.io>
|
|
|
|
| |
Signed-off-by: Jeremy J. Miller <jm@chef.io>
|
|
|
|
| |
Signed-off-by: Jeremy J. Miller <jm@chef.io>
|
|
|
|
| |
Signed-off-by: Jeremy J. Miller <jm@chef.io>
|
|
|
|
|
|
| |
department of redundancy department
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
|
| |
(#5781)
Signed-off-by: Tom Duffield <tom@chef.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`Chef::ReservedNames::Win32::Security::SID.current_user` throws an error when `chef-solo` is being
run as a `SYSTEM` user:
```
================================================================================
Chef encountered an error attempting to load the node data for "WIN-00P0BGAA4IV"
================================================================================
Unknown Server Error:
---------------------
The server had a fatal error attempting to load the node data.
Server Response:
----------------
Exception raised! #<Chef::Exceptions::Win32APIError: No mapping between account names and security IDs was done.
---- Begin Win32 API output ----
System Error Code: 1332
System Error Message: No mapping between account names and security IDs was done.
---- End Win32 API output ----
>
c:/opscode/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/win32/error.rb:81:in `raise!'
c:/opscode/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/win32/security.rb:383:in `lookup_account_name'
c:/opscode/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/win32/security/sid.rb:44:in `from_account'
c:/opscode/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/win32/security/sid.rb:241:in `current_user'
c:/opscode/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/chef_fs/file_system/repository/nodes_dir.rb:41:in `create_child'
```
This commit modfies these calls to use `SID.default_security_object_owner` instead which will return
`SID.Administrators` for users such as `SYSTEM` and then returns `SID.current_user` for everyone else.
Signed-off-by: Scott Christopherson <scott@chef.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, this code determined if an object existed by doing the
following:
parent.children.any? { |child| child.api_child_name == api_child_name }
For organizations and object types with a small number of total objects,
this wasn't problematic; however, it has very bad worst-case behavior.
For example, if a user was attempting to restore an organization with
30k client records to an empty organization, each client upload would do
the following:
1. Run GET /clients
2. Iterate the list returned in (1) normalizing the clients names along
the way.
3. Upload the client via POST when exist? returned false.
When the clients don't exist, this means step (2) will always iterate
over every member returned in step (1). By the time you get into the
1000s of clients, this iteration dominates the running time of the
process. For instance, consider the following ruby profile data:
Measure Mode: wall_time
Thread ID: 16939380
Fiber ID: 22163920
Total: 109.860468
Sort by: self_time
%self total self wait child calls name
26.83 29.475 29.475 0.000 0.000 500 <Class::IO>#select
8.60 38.876 9.446 0.000 29.430 464125 <Class::Chef::ChefFS::PathUtils>#join
7.02 12.226 7.717 0.000 4.509 928750 Chef::ChefFS::FileSystem::ChefServer::RestListEntry#api_child_name
6.79 7.459 7.459 0.000 0.000 930250 String#gsub
5.31 5.834 5.834 0.000 0.000 2320625 <Class::Chef::ChefFS::PathUtils>#regexp_path_separator
3.33 3.654 3.654 0.000 0.000 500 OpenSSL::X509::Store#set_default_paths
3.28 42.482 3.606 0.000 38.876 464125 Chef::ChefFS::FileSystem::BaseFSObject#initialize
2.95 3.244 3.244 0.000 0.000 930250 <Class::File>#extname
2.29 48.421 2.513 0.000 45.908 483375 *Class#new
38 wall clock seconds spent in PathUtils.join (part of the name
normalization during the list walk)
Note, an alternative might be to skip the exist? check completely,
opting to blindly POST and then rescuing the 409 and retry with a PUT.
Experimentation shows that PathUtils.join can also be improved
substantially; however, I'll leave those for a follow-up PR.
Signed-off-by: Steven Danna <steve@chef.io>
|
|
|
|
|
|
|
| |
This commit ensures that the `nodes` dir and the node files within
it are created with the correct permissions by chef-solo.
Signed-off-by: Scott Christopherson <scott@chef.io>
|
|
|
|
|
|
| |
files each time the command was fired.
Signed-off-by: aliasgar16 <aliasgar.batterywala@msystechnologies.com>
|