| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This was discussed in the last Chef Triage meeting.
In the great move to trace logging, which is great, idempotency check
logs moved to trace, which defeats the purpose. The goal is to keep
"internal chef" logging in trace so that when users are trying to figure
out why their cookbook isn't acting as expected they can look at debug
without having to see all the other cruft. But "here's why I didn't
install the package you said to install" is table-steaks "I'm trying to
debug my cookbook."
This moves those logs back to debug. There were a variety of cases where
logging was pretty nonstandard in other ways, but to keep this PR
scoped, I didn't change those.
I did fix a few related logging issues:
* A few warns that should have been debug in windows_task
* A few places where there was basically no logging whatsoever, I put a
few of the "I did X" logs to 'debug' (from trace). It coudl be argued
some of those should be 'info', but that's a bigger change that I
didn't want to put into this PR
Signed-off-by: Phil Dibowitz <phil@ipom.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`apt_package` never even looks at `new_resource.version` when deciding
what version to install. That's silly.
This fixes that. It requires the version be exact (as the `yum_package`
did for most of Chef's history), and if you specify a non-existent
version, it'll raise an exception.
The unit tests for this provider are a bit of a mess, so I kinda stuck
in the tests where I could.
```
[2021-02-07T15:59:35-08:00] TRACE: apt_package[hub] installed version for hub is 2.14.2-1vcrs.1
[2021-02-07T15:59:35-08:00] TRACE: apt_package[hub] candidate version for hub is 2.14.2-1vcrs.1
[2021-02-07T15:59:35-08:00] TRACE: apt_package[hub] hub 2.14.2-1vcrs.1 needs updating to 2.7.0~ds1-1vcrs.1
[2021-02-07T15:59:38-08:00] INFO: apt_package[hub] installed hub at 2.7.0~ds1-1vcrs.1
```
Signed-off-by: Phil Dibowitz <phil@ipom.com>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Layout/MultilineMethodCallBraceLayout
- Layout/ClosingParenthesisIndentation
- Layout/IndentFirstArgument
EnforcedStyle: consistent
- Layout/BlockEndNewline
the first of these autocorrected to horrible looking code which exposed
that we really needed the other three as well, which also cleaned up a
bunch of other terrible looking code.
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
|
|
|
|
| |
result of automation
https://github.com/chef/chefstyle/pull/72
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Signed-off-by: Kapil Chouhan <kapil.chouhan@msystechnologies.com>
Fix for Move response_file and response_file_variables out of base package resource
Signed-off-by: Kapil Chouhan <kapil.chouhan@msystechnologies.com>
update require changes
Signed-off-by: Kapil Chouhan <kapil.chouhan@msystechnologies.com>
Updated require changes
Signed-off-by: Kapil Chouhan <kapil.chouhan@msystechnologies.com>
Fixed some unit test cases
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: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
|
|
|
| |
converts all usage to just shell_out() from the numerous helper
utilities that we've had previously.
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
|
|
| |
just use shell_out_compact now.
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
|
|
|
|
| |
These resources don't coerce `package_name` to an array so would raise an
exception when trying to call `name.all?` when `package_name`, and thus `name`,
was a string.
Signed-off-by: Jonathan Hartman <j@hartman.io>
|
|
|
|
| |
Signed-off-by: Thom May <thom@chef.io>
|
|
|
|
|
|
|
|
| |
- If the user has already set some options, trust that they know what
they're doing
- Bonus fixup of the apt_package provider tests.
Signed-off-by: Thom May <thom@chef.io>
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Due to the nature of the comparison done, the `package_locked` methods
will always return false as they presume the package name is a string,
when it is in fact always coerced into an array.
Additionally in situations where the package_name is set rather than
being inherited from the package resource's name, it will always return
false.
Resolves #6361
Resolves #6493
Signed-off-by: Andy Wagner <andy@andywagner.ca>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If we don't have a version installed yet we shouldn't go do a version
comparison with nil. No matter what that's a waste of time and in
dpkg/apt it's going to require shelling out now. Instead just do the
install.
This also adds the same version comparison method to the dpkg resource.
At the moment it doesn't look like this is going to get called since our
upgrade action there is a bit broken (doesn't actually compare
versions), but that's going to get fixed next.
This also cleans up the version comparison to make sure we're
always dealing with strings
Signed-off-by: Tim Smith <tsmith@chef.io>
|
|
|
|
| |
Signed-off-by: Noah Kantrowitz <noah@coderanger.net>
|
|
|
|
| |
Signed-off-by: Mark Harrison <mark@mivok.net>
|
|
|
|
|
|
|
|
|
| |
- cleans up a lot of ivar usage
- converts most providers to shell_out_compact_timeout!
- almost deprecates a few APIs, but can't quite yet
- windows providers need mixlib-shellout to take an argv
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
no enforced trailing comma on arguments...
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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"
|
|
|
| |
Created via git ls-files | xargs perl -pi -e "s/(Copyright.*?), Opscode(,)? Inc(\.)?/\\1, Chef Software Inc./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.
|
|
|
|
| |
chefstyle -a fixed 1044 occurrances
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
since check_package_state calls itself to check virtual packages the
array building it does was getting indexed incorrectly as the virtual
packages were getting inserted into arrays that were supposed to be
indexed by the package arguments the user gave. there was also a bug
which broke idempotency with virtual packages and would cause virtual
packages to get reinstalled every time (installed_version not geting
correctly inherited from the virtual package).
WIP2
remove debug
fix specs
|
|
|
|
|
|
|
|
|
| |
make this a hash based on name so that when we pass an array of
names to install_package we can look up the right one and do not
have to synchronize arrays.
we should probably convert the arrays in the superclass to hashes
based on name as well.
|
|
|
|
|
|
|
| |
- fixes define_resource_requirements
- better idempotency (only packages that need updating are updated)
- better messaging (only packages that update are output)
- better comments
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the apt provider attempts to check if it has a provider that
responds to :default_release (i.e. a real apt_package resource) via
if the provider attribute is explicitly set or not, which is relying
on a side-effect which broke in 12.0. the correct behavior is just
to duck-type the new_resource object and see if it
respond_to?(:default_release) and then use it if it does.
Also the unit tests were not testing the apt_provider against both the
package and apt_package resources. Added some hacky spec code (which
needs a cleanup) to at least exercise the use cases.
|
|
|
|
| |
mechanically generated patch using transpec 2.3.7 gem
|
|
|
|
|
| |
makes resource and provider class resolution more dynamic.
begins deprecation of Chef::Platform static mapping.
|
|
|
|
| |
functionality to fix resource notifications and ChefSpec stubs.
|
| |
|
|\
| |
| | |
[CHEF-5168] Apt Package provider times out
|
| |
| |
| |
| |
| | |
- Convert APT package resource to use `provides :package`
- Add timeout parameter
|
| | |
|
|/ |
|
| |
|