HomePhorge

Move mode management into the providers
22bfd9ce83ffUnpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

Move mode management into the providers

Previously, the logic for getting and setting file mode was
implemented in the type's retrieve and sync methods of the mode
property itself.

This commit adds a validate method to the type (previously validating
was being done in munge), and adds 'mode' and 'mode=' methods to the
POSIX and Windows file providers. The POSIX provider does what it did
before, and the Windows provider contains the same broken mode-logic
that it did before. Actually translating file permissions, e.g. 0755,
to Windows will be done in a later commit.

This commit also fixes tests on Windows where the file mode was being
set by Puppet::Util::Windows::Security, but read back using File.stat,
which doesn't round-trip. Now the test uses the security module for
both setting and getting.

Disabled symlink tests on Windows, which are not supported.

Details

Provenance
Nick Lewis <nick@puppetlabs.com>Authored on
Josh Cooper <josh@puppetlabs.com>Committed on Sep 27 2011, 6:55 PM
vanmeeuwenPushed on Jun 2 2015, 2:22 PM
Parents
rPU4c3aae847022: Fix typo bug that prevented FILE_DELETE_CHILD from being set
Branches
Unknown
Tags
Unknown

Event Timeline

Josh Cooper <josh@puppetlabs.com> committed rPU22bfd9ce83ff: Move mode management into the providers (authored by Nick Lewis <nick@puppetlabs.com>).Sep 27 2011, 6:55 PM