| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
closes #8817
Note that if any calling code winds up seeing this error message:
```
NoMethodError: undefined method `set_cookbook_attribute' for nil:NilClass
```
That means that the cookbook_collection was set before the node was
set on the run_context. That wouldn't be a bug in core chef, that must
be fixed in the caller to reverse the order of operations.
Since I only made the positional arguments to the run_context constructor
optional in Chef-15.0 though I don't expect this breaks any existing code
written in the past month or two, but if anything crops up in the future,
consider this a definitive statement that the caller must reverse the
order of their operations and this error being thrown is a feature not
a bug to be fixed.
(The fact that we silently aborted rather than threw a NoMethodError on
NilClass meant that we shipped this defect -- sometimes defensive
programming can be overly defensive and swallow real errors).
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
this is using:
Layout/AlignArguments:
Enabled: true
EnforcedStyle: with_fixed_indentation
the default style can use really excessive whitespace. on starting
lines which are already long, it fully indents across to where the
arguments start and then begins the line there.
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
| |
Signed-off-by: Marc Chamberland <mchamberland@pbsc.com>
|
|
|
|
| |
Signed-off-by: Marc Chamberland <mchamberland@pbsc.com>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Marc Chamberland <mchamberland@pbsc.com>
|
|
|
|
|
|
|
|
|
| |
Allow for allocation of the Chef::RunContext without its arguments and
use that to allocate it early. The APIs are kept backcompatible since
otherwise this has a decent chance of blowing up something like
chefspec.
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
|
|
| |
It's used all over and very much stable at this point
Signed-off-by: Tim Smith <tsmith@chef.io>
|
|
|
|
|
|
| |
See the PR for details on this change.
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
|
|
| |
includes backcompat for 2.5
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
|
|
|
|
|
|
|
| |
to_hash on a lot of these objects should go away, but even eliminating
all our calls to to_hash on these objects internally is difficult.
(e.g. converting the knife ui code to call #to_h means we wind up
calling nil#to_h which "helpfully" becomes '{}' which is hilarious and
i don't know why someone thought that was a good idea).
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
| |
Signed-off-by: Thom May <thom@chef.io>
|
|
|
|
|
|
|
| |
We also now set chef_environment the same as policy group when that's
appropriate
Signed-off-by: Thom May <thom@chef.io>
|
|
|
|
| |
Signed-off-by: Jon Cowie <jonlives@gmail.com>
|
|
|
|
|
|
| |
This commit implements RFC-105 and adds specs to verify attribute hoisting is working correctly in conjunction with existing attributes.
Signed-off-by: Jon Cowie <jonlives@gmail.com>
|
|
|
|
| |
Signed-off-by: Tyler Cloke <tylercloke@gmail.com>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
/cc @coderanger @danielsdeleo
We have been looking for an easy way to get this value into our error
reporting application and it surprised me that it isn't already
captured. If there's a better way to do this totally open for thoughts!
Signed-off-by: John Bellone <jbellone@bloomberg.net>
|
|
|
|
|
|
| |
ie, only when we're in OG mode and not in local mode.
Signed-off-by: Thom May <thom@chef.io>
|
| |
|
| |
|
|
|
|
|
| |
this is part of our informal style guide, lets make it formal since
clearly its not getting followed very well.
|
|\
| |
| | |
RFC-060 gem metadata MVP
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
this leverages the PR:
https://github.com/bundler/bundler/pull/4245
to redirect output from bundler into chef's logger/formatter to get the
UI right. if you don't have that in the external bundler you'll just
get output on STDOUT. fix is to upgrade bundler.
|
| | |
|
|/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
| |
Generated via git ls-files | xargs perl -pi -e "s/(Author.*?<[^@]+@)(?:opscode\\.com|getchef\\.com)(>)/\\1chef.io\\2/gi"
|
|
|
| |
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"
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
| |
Also, improve the language around unsupported features/options.
|
| |
|
|
|
|
| |
Also, mark internal public API as @private
|
| |
|
| |
|
| |
|
|
|
|
| |
also wire them up through the Chef class.
|
|
|
|
|
|
|
|
|
| |
Cookbook artifacts differ in these ways:
* the name field is the cookbook name instead of name+version
* there is no "cookbook_name" field
* cookbook artifacts don't have a json_class when downloaded from the
server
* there is an identifier field
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
FileVendor previously was configured by storing a closure/anonymous
function as a class instance variable. This had the following downsides:
* The API was too general, which caused a lot of code repetition
* The block was lazily evaluated, which hid errors and made testing more
difficult
* The closures captured references to classes with references to large
data structures, which complicates GC.
Since we've only ever had the same two implementations of FileVendor, we
can encapsulate configuration of the FileVendor factory by wrapping each
configuration option in a method. As a side benefit, arguments to these
methods will be eagerly evaluated, which makes it easier to detect
errors.
|
|
|
|
| |
environment names to empty strings
|
| |
|