summaryrefslogtreecommitdiff
path: root/lib/chef/mixin
Commit message (Collapse)AuthorAgeFilesLines
* Cleanup some YARD warningsyard2Tim Smith2017-12-131-1/+1
| | | | Signed-off-by: Tim Smith <tsmith@chef.io>
* Fix remote_file with UNC paths failingnodes_not_hereTim Smith2017-10-191-1/+1
| | | | | | | | | | Our check here to see if we're on Windows uses node data that's not available in this context. Use the same Chef::Platform.windows? check we use above. Without this you get the following error: [2017-10-02T21:40:42+00:00] DEBUG: Re-raising exception: NameError - remote_file[c:/foo/bar] (foo::default line 14) had an error: NameError: undefined local variable or method `node' for #<Chef::Provider::RemoteFile::NetworkFile:0x00000000064c0148> Signed-off-by: Tim Smith <tsmith@chef.io>
* Fixing specsnimisha2017-09-051-1/+1
| | | | Signed-off-by: nimisha <nimisha.sharad@msystechnologies.com>
* Added define_resource_requirement and some other validationsnimisha2017-09-051-0/+4
| | | | Signed-off-by: nimisha <nimisha.sharad@msystechnologies.com>
* Alternate user local logon authenticationnimisha2017-09-052-96/+1
| | | | Signed-off-by: nimisha <nimisha.sharad@msystechnologies.com>
* Alternate user remote file code review feedbackadamedx2017-09-051-2/+2
|
* Access remote_file resource source files as alternate user on Windowsadamedx2017-09-052-2/+2
| | | | | Conflicts: spec/support/shared/functional/execute_resource.rb
* Windows thread alternate user impersonation supportadamedx2017-09-051-0/+62
|
* Windows user identity user name and credntial validationAdam Edwards2017-09-051-0/+81
|
* Fix an issue where DeepMerge overwrites nil valuesDJ Mountney2017-08-101-1/+1
| | | | | | | | | | When run against a VividMash. Call .key? instead of [] when checking if a key exists for a VividMash Otherwise the VividMash will return an empty object instead of nil for that key. Signed-off-by: DJ Mountney <david@twkie.net>
* Ensure that we check the embedded gem binary lasttm/gem_pathThom May2017-05-161-1/+1
| | | | | | | | | | Previously we injected our expected paths in to ENV['PATH'] but we stopped doing that in Chef 13; for gem_package, we need to ensure that if all else fails we'll use the Omnibus provided gem binary, but we should never pick that if we can find a different one. Closes: #6103 Signed-off-by: Thom May <thom@chef.io>
* spec fixes and Path-v-PATH cleanupLamont Granquist2017-04-061-9/+9
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* try Path on windowsLamont Granquist2017-04-061-1/+9
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Chef-13: shell_out PATH fixes and path_sanity changesLamont Granquist2017-04-062-47/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Turns out polluting PATH with a global path_sanity actually tends to cause problems via picking up stuff from e.g. embedded/bin when users don't want it. This change unsets the default setting to add path sanity. We already have the difference between internal and external uses of shell_out, so what this does is take the internal use of shell_out and always apply the PATH -- so anything calling shell_out gets path_sanity. It also modifies path_sanity to prepend the ruby bin and the embedded bin into the PATH. When we need those for internal use we really want those first. Users who don't want path sanity at all can do: shell_out_with_systems_locale(*whatever) or: shell_out(*whatever, env: { "PATH" => ENV['PATH'] }) Next PR I want to add: shell_out(*whatever, internal: false) Default will still be true though. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* remove the platform-specific run_command codeLamont Granquist2017-03-312-291/+0
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Chef-13: remove deprecated run_command API entirelyLamont Granquist2017-03-311-194/+0
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Retry API requests if using an unsupported versiontm/retryable_apiThom May2017-03-291-0/+4
| | | | Signed-off-by: Thom May <thom@chef.io>
* Allow the best API version to be queriedThom May2017-03-281-1/+12
| | | | | | Also tidy up in the face of the real world. Signed-off-by: Thom May <thom@chef.io>
* Chef-13: Nillable propertiesLamont Granquist2017-03-151-5/+6
| | | | | | | remove deprecations and now properties are nillable and passing a nil is now always a set, not a get. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Make it easier to have a versioned factorytm/versioned_apiThom May2017-02-141-14/+34
| | | | | | | classes providing an API should include VersionedAPI, whilst the factory class includes VersionedAPIFactory. Signed-off-by: Thom May <thom@may.lt>
* Beginning of automatic API version detectionThom May2017-02-141-0/+49
| | | | | | | | | When we make a request to a chef server, we capture the minimum and maximum support API versions and allow them to be queried. We then provide some infrastructure for making decisions on which class should be used, in a middleware-ish mechanism. Signed-off-by: Thom May <thom@chef.io>
* fix specs: RedundantReturn, RedundantSelf, RedundantBeginLamont Granquist2017-02-1311-38/+30
| | | | | | department of redundancy department Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* package provider cleanuplcg/package-cleanupLamont Granquist2017-02-112-4/+24
| | | | | | | | | - 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>
* add tests for 'where'Lamont Granquist2017-02-071-1/+1
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* add unit tests for `which` behaviorLamont Granquist2017-02-071-1/+6
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* fix return of which()Lamont Granquist2017-02-071-1/+1
| | | | | | also clean up a confusing spec test Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* rhel7 / dnf 2.0 fixes / improved errorsLamont Granquist2017-02-071-7/+19
| | | | | | | | | - fixes for dnf 2.0 / rhel7 - improved error messages from python helper (gives python stack traces instead of just EPIPE all the time) - improved which/where interface in the which mixin. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Merge pull request #4894 from chef/lcg/dnf-providerLamont Granquist2017-01-111-9/+5
|\ | | | | DNF Provider PR #2
| * squashing dnf workLamont Granquist2016-12-131-9/+5
| | | | | | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* | cleanup of group providerlcg/group-provider-cleanupLamont Granquist2016-12-211-12/+58
| | | | | | | | | | | | | | | | - consistent use of shell_out_compact! - remove more uses of run_command - some other code cleanup Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* | remove run_command from groupaddLamont Granquist2016-12-201-0/+9
| | | | | | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* | formally deprecate run_commandLamont Granquist2016-12-201-0/+1
|/ | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* fix Style/SelfAssignmentLamont Granquist2016-12-062-2/+2
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Merge pull request #5547 from chef/lcg/unified-integerLamont Granquist2016-11-161-19/+19
|\ | | | | Core: fix Lint/UnifiedInteger cop
| * simplify some overly complicated powershell codelcg/unified-integerLamont Granquist2016-11-151-19/+19
| | | | | | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
| * fix Lint/UnifiedInteger copLamont Granquist2016-11-151-1/+1
| | | | | | | | | | | | believe this becomes necessary for ruby 2.4/3.0 Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* | Structure deprecations with additional metadatatm/deprecation_with_urlThom May2016-11-162-11/+5
|/ | | | | | | | This adds URLs to each class of deprecation, and correctly prints and formats them for maximum user efficiency. We also provide the URL to the data collector for Visibility to ingest. Signed-off-by: Thom May <thom@chef.io>
* More Opscode -> Chef updatesTim Smith2016-10-201-1/+1
| | | | Signed-off-by: Tim Smith <tsmith@chef.io>
* Fixed double quotes issue in powershell_outNimishaS2016-10-071-1/+1
| | | | Signed-off-by: NimishaS <nimisha.sharad@msystechnologies.com>
* Revert Handling double quotes in powershell_outMatt Wrock2016-10-051-10/+2
| | | | Signed-off-by: Matt Wrock <matt@mattwrock.com>
* Raising Mixlib::ShellOut::ShellCommandFailed exceptionNimishaS2016-10-031-2/+2
| | | | Signed-off-by: NimishaS <nimisha.sharad@msystechnologies.com>
* Handling double quotes. Added specsNimishaS2016-09-301-2/+10
| | | | Signed-off-by: NimishaS <nimisha.sharad@msystechnologies.com>
* Fixed undefined short_cksum method issue and checksum in uppercase issue for ↵Aliasgar162016-09-201-0/+5
| | | | | | | | | | windows_package resource. (#5332) * Fixed undefined short_cksum method issue and checksum in uppercase issue for windows_package resource. * Added RSpecs for the changes done here. * Fixed RSpecs issues.
* Allow flagging a resource property as sensitiveadamleff/sensitive-propertiesAdam Leff2016-08-251-0/+3
| | | | | | | | | | | | 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.
* clean up everythingLamont Granquist2016-08-231-0/+30
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Stop using obsolete URI.escape; use Addressable::URI instead.John Keiser2016-08-221-1/+2
| | | | See http://stackoverflow.com/questions/2824126/whats-the-difference-between-uri-escape-and-cgi-escape#answer-13059657 for details on why.
* fix Style/BlockDelimiters, Style/MultilineBlockLayout and 0.42.0 engine upgradeLamont Granquist2016-08-173-5/+5
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* fixing Style/MultilineTernaryOperator copLamont Granquist2016-08-161-4/+3
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* make deprecation warnings actual deprecation warningsLamont Granquist2016-04-251-1/+1
|
* remove duping the args hashlcg/shell_out_syntaxLamont Granquist2016-04-251-1/+0
| | | | | we only ever did this in order to mutate the options and with the **options syntax we don't need to do this anymore.