| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Signed-off-by: Pete Higgins <pete@peterhiggins.org>
|
|
|
|
| |
Signed-off-by: Pete Higgins <pete@peterhiggins.org>
|
|
|
|
| |
Signed-off-by: Pete Higgins <pete@peterhiggins.org>
|
|
|
|
| |
Signed-off-by: Pete Higgins <pete@peterhiggins.org>
|
|
|
|
|
|
| |
WARNING: Using `expect { }.not_to raise_error(SpecificErrorClass)` risks false positives, since literally any other error would cause the expectation to pass, including those raised by Ruby (e.g. NoMethodError, NameError and ArgumentError), meaning the code you are intending to test may not even get reached. Instead consider using `expect { }.not_to raise_error` or `expect { }.to raise_error(DifferentSpecificErrorClass)`. This message can be suppressed by setting: `RSpec::Expectations.configuration.on_potential_false_positives = :nothing`. Called from /Users/pete/work/chef/spec/unit/resource_spec.rb:381:in `block (4 levels) in <top (required)>'.
Signed-off-by: Pete Higgins <pete@peterhiggins.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a breaking change to fix a breaking change in Chef 16.0.
The new behavior is that a resource which relies upon the reource_name
statement to wire the resource up to the DSL will fail (although the
very old wiring of the "<cookbook_name>_<resource filename>" continues
to work).
So for a resource which does not get its DSL wiring from the filename,
only declaring a resource_name will fail:
```
resource_name :foo
```
This can be fixed by adding an explicit `provides` line (which is
backwards compatible):
```
resource_name :foo
provides :foo
```
If backwards compatibility is not a concern, then post-16.0 the
resource_name call can be completely dropped:
```
provides :foo
```
This is a vastly simpler backwards compatibility break than the
unintentional break in #9885, which is difficult to describe and
to detect.
The rules going forward are fairly simple to explain:
1. The resource_name now only sets the resource_name.
2. The old behavior of the fallback resource_name and DSL wiring
based on the filename is preserved (unless the values are set).
3. In Chef 16, The first provides line will set the resource_name if
it has not already been set, allowing the resource_name to be
omitted.
It is recommended that all resources only set provides lines, the
use of the fallback filename-based wiring is discouraged and
explicitly setting the resource_name is discouraged.
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>
|
|
|
|
| |
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
| |
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
|
|
| |
this should pass on both now
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
| |
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
|
|
|
|
| |
zero args methods don't get parens.
this certainly reads better than the inverse.
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>
|
|
|
|
|
|
|
| |
Switch to only doing warnings. Remove the features in the node_map that
we never used.
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
|
|
|
| |
this is the result of changes to rules we already previously had
enabled.
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
| |
Signed-off-by: Kapil Chouhan <kapil.chouhan@msystechnologies.com>
|
|
|
|
| |
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: Noah Kantrowitz <noah@coderanger.net>
|
|
|
| |
Signed-off-by: Noah Kantrowitz <noah@coderanger.net>
|
|
|
|
| |
Signed-off-by: Noah Kantrowitz <noah@coderanger.net>
|
|
|
|
| |
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
|
|
| |
Some day I will remember which is which on string styles.
Signed-off-by: Noah Kantrowitz <noah@coderanger.net>
|
|
|
|
| |
Signed-off-by: Noah Kantrowitz <noah@coderanger.net>
|
|
|
|
| |
Signed-off-by: Thom May <thom@chef.io>
|
|
|
|
|
|
| |
Missed this one
Signed-off-by: Tim Smith <tsmith@chef.io>
|
|
|
|
| |
Signed-off-by: Noah Kantrowitz <noah@coderanger.net>
|
|
|
|
| |
Signed-off-by: Noah Kantrowitz <noah@coderanger.net>
|
|
|
|
| |
Signed-off-by: Noah Kantrowitz <noah@coderanger.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This makes nameless resources work in the DSL:
```ruby
apt_update
```
It does it by giving it an empty-string name of ""
It also drops support for multi-arg resources, that has been deprecated
for some time:
```ruby
some_resource "foo", "bar", "baz"
```
Note that multipackage package resources do not use multiple args, but a
single argument which is an arry:
```ruby
package [ "lsof", "strace", "tcpdump" ]
```
So this change does not affect that usage. Multi-arg has been
deprecated for some time now and its not clear that it was ever used by
anyone.
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Without this, sending an interrupt signal (hitting Ctrl+C) during a
chef-client run that is currently executing a resources that has
`retries` set will not interrupt the run, although the interrupt handler
set up in Chef::Application calls Process.exit, which raises SystemExit.
If the retryable resource is shelling out, the spawned process also gets
the INT signal and will stop -- however, the chef-run would go on,
merely noticing that the resource has failed and theres X-1 retries
left.
It is imaginable that users depend on some (whacky) Ruby script in a
retriable resource that raises SystemExit, and they want this to _not_
stop the chef-run. So it's up for debate if we just want to merge this
or make it configurable.
In general, I'd like Ctrl+C to _stop my chef-run_, but this expectation
could also be misled.
When adapting tests to this change, it became apparent that for some
reason the runner_spec.rb test didn't behave as expected. I've thus made
those tests a little stricter by replacing some allows by expects.
Signed-off-by: Stephan Renatus <srenatus@chef.io>
|
|
|
|
|
|
| |
Switch over the Chef-12.0 ProviderResolver is now completed.
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
| |
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
| |
Signed-off-by: Thom May <thom@chef.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
most of this deletes useless old code.
the change to lookup_provider_constant changes to more strictly
stop using class name based lookups and to go through the resource
resolver and provider resolver.
as a result in order to find the provider class for a given dsl name
you have to go through the resource resolver to find the resource in
order to be able to pass a resource instance through the provider
resolver. since the provider resolver api passes resources into blocks
passed into provides api you must construct a resource instance.
that means that providers need to be associated with resources in order
to be looked up (which makes sense in Real Life(tm) use of Chef, but
breaks quite a few lazy tests we had where we constructed providers
without doing the work of wrapping them in a resource.
note that as the deploy resource shows this filters into a changed
behavior of the `provider` syntax where before `provider :revision`
would look up Chef::Provider::Deploy::Revision via class-name based
magic. this breaks that API so that `provider :deploy_revision` is
used instead -- the symbol (or string) there is turned into a resource
first via the Chef::ResourceResolver and then looked up via the
Chef::ProviderResolver into Chef::Provider::Deploy::Revision. this
is a breaking change but is also a bug fix so that the symbol here
goes through the same lookup that you get when you type it in the DSL.
i had considered implementing a lookup from a resource_name symbol to
a provider, but in looking at how to implement that in the
ProviderResolver the issue is that we really need to have a resource
instance order to pass to the ProviderResolver.
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
|
|
|
| |
converts sensitive, retries, retry_delay and ignore_failure to
properties
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
still there on service (where it makes some sense)
also still on mount (because i have no idea if that is actively being
used or if it makes any sense at all).
converts it to a property on mount + service as well.
also removed setting it as an array -- did we ever document that and/or
does anyone use it? i'm not religiously against that way of setting
it, but if nobody ever used it i'd rather remove the YAGNI.
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
| |
Signed-off-by: Tom Duffield <tom@chef.io>
|
|
|
|
|
|
|
|
| |
These should have been deprecated formally in 12.5.1 after the
Dynamic Provider-Resolver'ing of the internal chef resources
was completed.
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some properties in custom resources may include sensitive data, such as a
password for a database server. When the Resource's state is built for use by
Data Collector or similar auditing tool, `Chef::Resource#state_for_resource_reporter`
builds a hash of all state properties for that resource and their values. This
leads to sensitive data being transmitted and potentially stored in the clear.
This change enhances properties with the ability to set an individual property
as sensitive and then have the value of that property suppressed when exporting
the Resource's state.
|
|
|
|
| |
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
| |
|
|
|
|
| |
no enforced trailing comma on arguments...
|
| |
|
|
|
|
|
|
|
|
|
| |
Style/NegatedWhile
Style/ParenthesesAroundCondition
Style/WhileUntilDo
Style/WordArray
Performance/ReverseEach
Style/ColonMethodCall
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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"
|