summaryrefslogtreecommitdiff
path: root/lib/chef/provider/file.rb
Commit message (Collapse)AuthorAgeFilesLines
* Fixed undefined short_cksum method issue and checksum in uppercase issue for ↵Aliasgar162016-09-201-6/+1
| | | | | | | | | | 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.
* Revert "Merge pull request #5123 from chef/lcg/resolv-replace"John Keiser2016-08-081-8/+0
| | | | | This reverts commit e8877cd363642ed6757c48d1ed5ab35509d87e22, reversing changes made to 162d988d3bcfce2773ef2831fa33e416f53731f6.
* only work around resolver caching on linuxLamont Granquist2016-07-191-1/+2
| | | | | it should be the only O/S which needs it due to the way its glibc was written. it is the only O/S that we've recieved any bugs for.
* replace glibc resolver with ruby resolverLamont Granquist2016-07-191-0/+7
| | | | also wires up file providers to reload /etc/reoslv.conf when it changes.
* autofixing whitespace copsLamont Granquist2016-02-051-3/+3
| | | | | | | | | | | | | | | | | | | | | | 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
* Update all auth email address from opscode.com and getchef.com to chef.io.Noah Kantrowitz2016-02-021-2/+2
| | | Generated via git ls-files | xargs perl -pi -e "s/(Author.*?<[^@]+@)(?:opscode\\.com|getchef\\.com)(>)/\\1chef.io\\2/gi"
* Copyright year update for 2016 and massive cleanup.Noah Kantrowitz2016-02-021-1/+1
| | | 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"
* Use double quotes by defaultThom May2016-01-141-16/+16
| | | | | | | 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.
* autocorrecting Style/TrailingCommalcg/trailing_commaLamont Granquist2016-01-131-2/+2
| | | | chefstyle -a fixed 1044 occurrances
* implement verifications as a propertyLamont Granquist2015-12-141-1/+1
| | | | | | the unit tests on this one did some excessive stubbing/mocking, i just let them create a real verification object which the 'true' or 'false' then failed (for real).
* Use the central priority map for `provides`John Keiser2015-06-021-0/+1
|
* Move Chef::Config into a subprojectdanielsdeleo2015-05-201-0/+1
|
* create Chef::Resource#state_for_resource_reporterLamont Granquist2015-05-011-2/+6
| | | | | | Use this to override the state reported by the resource reporter while avoiding the collision over Chef::Resource#state being used by some LWRPs.
* don't mutate the new resourceLamont Granquist2015-05-011-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | this line violates the rule that we never mutate the new resource. in Chef 12 this causes real problems because if a file resource is notified (run twice) then the rendered content is loaded into the new resource and if the file resource content changes (i.e. its a template with logic which changes when its notified) then it will cause a failure because the rendered content will not match the 'requested' checksum. where the 'requested' checksum is actually the checksum loaded by this line. fundamentally we have three different states that we're trying to track: - current state - initial state - requested state the removed line tries to use the @new_resource for reporting initial state, which then bleeds over into what chef thinks is requested state in the next invokation. without constructing a third @initial_resource and using that for resource reporting comparison we can't solve this problem "right". the tradeoff is we either break reporting here or break chef-client runs. this patch sacrifices reporting in order to make chef-client work.
* Implement RFC 027 File VerificationSteven Danna2015-02-171-0/+8
| | | | | | | | This implements usable-suppliable file content verification per RFC 027. Users can supplie a block, string, or symbol to the `verify` resource attribute. Blocks will be called, string will be executed as shell commands (respecing the same options as not_if and only_if), and symbols can be used to access built-in registered validations.
* Chef-12 RC Provider ResolverLamont Granquist2014-10-241-0/+2
| | | | | makes resource and provider class resolution more dynamic. begins deprecation of Chef::Platform static mapping.
* Merge pull request #1715 from opscode/lcg/file-provider-fixeslamont-granquist2014-08-091-33/+84
|\ | | | | Lcg/file provider fixes
| * small code rearrangement, avoid re-checksummingLamont Granquist2014-07-301-5/+5
| |
| * validate checksums on downloadsLamont Granquist2014-07-301-1/+13
| |
| * some coderage cleanupLamont Granquist2014-07-301-16/+47
| | | | | | | | | | now i can sort of understand what manage_symlink_source actually does and this reads correct to me.
| * add comment on magic behaviorLamont Granquist2014-07-301-0/+1
| |
| * generate content up frontLamont Granquist2014-07-291-1/+6
| |
| * decide if we're creating/unlinking up frontLamont Granquist2014-07-281-22/+24
| |
* | fixing all the extra blank linesLamont Granquist2014-07-291-1/+0
| | | | | | | | yes, i just used rubocop on the chef sourcecode...
* | add shell_out to base provider codeLamont Granquist2014-07-291-2/+0
|/
* CHEF-5015 force_unlink should only unlink if the file existsJeremiah Snapp2014-03-281-1/+1
|
* Update file providers to close before unlinking.danielsdeleo2014-02-031-0/+1
| | | | | | | | This is required on windows, but the Tempfile implementation hides this and silently ignores the error, meaning that we're leaving tempfiles around on windows after we thought we'd cleaned them up. Eventually GC would get to them, but this won't happen if there is a severe crash or something calls `Kernel.exit!`, so we prefer to clean up manually.
* Restore checksums in the output.sersut2014-01-171-13/+9
|
* Merge remote-tracking branch 'goodmanio/CHEF-4639' into CHEF-4639-updatedsersut2014-01-171-6/+20
|\
| * fixes CHEF-4639Allen Goodman2013-12-061-3/+7
| |
| * RefactorAllen Goodman2013-11-181-6/+10
| |
| * If a resource is sensitive, it’s redacted from logs.Allen Goodman2013-11-151-1/+7
| |
* | OC-10380: add polymorphismLamont Granquist2013-11-111-19/+9
| |
* | OC-10380: skip checksumming for no-content filesLamont Granquist2013-11-111-5/+28
|/
* Use symlink source when inspecting current permissionsdanielsdeleo2013-07-021-1/+2
| | | | | | | | | | | Fixes CHEF-4341 http://tickets.opscode.com/browse/CHEF-4341 When manage_symlink_source is enabled, File providers update current_resource with the security attributes of the source file. Subsequent actions (e.g., running FileAccessControl) use the values set on current_resource to determine if they need to modify the system, so setting them incorrect leads to a file resource being (not) updated incorrectly.
* Allow file resources to manage files via symlinkdanielsdeleo2013-06-261-15/+96
| | | | | | | | | | Fixes CHEF-4312 http://tickets.opscode.com/browse/CHEF-4312 Adds resource attribute `manage_symlink_source` to file resource and descendents. When true, file resources will manage the source file when a symlink exists at the destination path. When nil (default), the source file is managed, but a warning is emitted. When false, symlinks are not followed. In Chef 12, the default should be changed to false.
* Determine if ACL mgmt follows symlinks by provider type.danielsdeleo2013-06-251-0/+7
| | | | | | | | - Prerequisite for CHEF-4312 fix. - File access control defers to the provider to determine whether to use link-following system calls or not (e.g., chmod vs. lchmod). File provider and subclasses will use link-following calls (chmod), Link provider uses calls that manage the symlink itself (e.g., lchmod).
* Unit specs for selinux code.sersut2013-05-231-1/+1
|
* Fix specs on windows.sersut2013-05-231-8/+5
|
* force_unlink socket tests.sersut2013-05-221-4/+5
|
* force_unlock tests for blockdev & chardevsersut2013-05-221-1/+2
| | | | force_unlink specs for blockdev, chardev, pipe.
* Directory specs for force_unlink.sersut2013-05-221-3/+11
|
* force_unlink tests for symlinks.sersut2013-05-221-6/+11
|
* Fix comments that include FIXME / TODO / XXX.sersut2013-05-201-3/+4
|
* Rename file config parameters to be file_atomic_update & ↵sersut2013-05-201-2/+2
| | | | file_staging_uses_destdir
* Make selinux util a module.sersut2013-05-171-2/+3
|
* Cache system's selinux state to minimize the impact. Tidy debug logs.sersut2013-05-161-10/+5
|
* Remove ability to override selinux restorecon command. Tidy selinux config ↵sersut2013-05-161-8/+17
| | | | option.
* Move file content management logic outside of providers under ↵sersut2013-05-161-1/+2
| | | | Chef::FileContentManagement for reusability in the future.
* Deprecated functions for file provider.sersut2013-05-151-29/+9
|