summaryrefslogtreecommitdiffstats
path: root/src/lib/Client/Tools/POSIX.py
Commit message (Collapse)AuthorAgeFilesLines
* Allow to run directly from a git checkout (#1037)Sol Jerome2012-03-241-943/+0
| | | | Signed-off-by: Sol Jerome <sol.jerome@gmail.com>
* Remove svn keywordsSol Jerome2012-02-191-1/+0
| | | | Signed-off-by: Sol Jerome <sol.jerome@gmail.com>
* Remove problematic tabs from file.Raul Cuza2011-12-091-1/+1
| | | | * Ticket 1080
* Show prompt when only the permissions of a file have changed, and notJoe Digilio2011-11-041-0/+6
| | | | the contents.
* properly initialize content so that non-existant files don't get readChris St. Pierre2011-10-311-0/+1
|
* initialize longtime correctlyChris St. Pierre2011-10-281-1/+1
|
* Made Verifyfile() much more efficient and resilient:Chris St. Pierre2011-10-281-99/+148
| | | | | | | | | | * Use file size to do an initial comparison to see if the file on disk differs from the data in the config; * Only do diffs if necessary: unified diff if -I is used, ndiff if a file is not sensitive or binary; * Both diffs have timeouts; * Fixed edge case where null-content binary files would produce stack traces, not errors.
* POSIX: Honor the user's umaskHolger Weiß2011-09-141-7/+7
| | | | | | | | The umask was set to zero in order to address the issue that mknod(2)'s mode argument is modified by the process's umask. However, this umask setting also affected auto-created parent directories of configuration entries: their permissions were set to `drwxrwxrwx'. So, we now call chmod(2) after mknod(2) instead of setting the umask to zero.
* POSIX: Unset umask (Resolves #1031)Sol Jerome2011-08-261-0/+7
| | | | Signed-off-by: Sol Jerome <sol.jerome@gmail.com>
* Remove useless parenthesesHolger Weiß2011-06-301-4/+4
|
* New Info attribute: "sensitive"Holger Weiß2011-06-291-5/+9
| | | | | | The contents/diffs of <Path>s which are marked as "sensitive" are now omitted from the reports transmitted to the server, so that they won't end up in the statistics database.
* POSIX: Add recursive permissions (Ticket #871)Sol Jerome2011-06-181-2/+57
| | | | | | | This allows for a recursive='true' attribute such that the owner/group can be set recursively for a directory when using Path type='permissions'. Signed-off-by: Sol Jerome <sol.jerome@gmail.com>
* Client Tools: Add PY3K compatibilitySol Jerome2011-06-151-8/+20
| | | | Signed-off-by: Sol Jerome <sol.jerome@gmail.com>
* POSIX: Detect missing cache directory failuresSol Jerome2011-06-141-2/+9
| | | | Signed-off-by: Sol Jerome <sol.jerome@gmail.com>
* Create non-ASCII diffsHolger Weiß2011-06-141-9/+19
| | | | | | | | | | | The client now also transmits diffs of files which include non-US-ASCII data (using the encoding setting from Options.py), unless they look like binary files. In the past, non-ASCII files were transmitted as Base64 blobs. In addition, "bcfg2 -I" no longer refuses to display non-ASCII diffs. Resolves ticket #999.
* POSIX: Clarify normalization error (Reported by Tim Goodaire)Sol Jerome2011-06-141-2/+4
| | | | Signed-off-by: Sol Jerome <sol.jerome@gmail.com>
* Lots of cleanup for bcfg2-repo-validate rewrite:Chris St. Pierre2011-04-211-11/+11
| | | | | | | | | * Changed all references to bcfg2-repo-validate in the documentation to bcfg2-lint * Wrote man pages for bcfg2-lint and bcfg2-lint.conf * Cleaned up straggling references to bcfg2-repo-validate in Makefiles, spec files, and the POSIX tool * A few minor bug fixes
* Better handling of backup files in paranoid mode (Patch from mkd ticket #995)Sol Jerome2011-03-061-3/+4
| | | | | | | | | | | | | | | | | | | | 1. Client removes only one excess backup copy at every configfile change, even if there are more backup copies eligible for deletion. Moreover, lowering the max_copies parameter could cause client to never remove any excess files from there. 2. Space character in backup file names is mildly annoying - datetime.isoformat() will put a 'T' there instead. 3. More robust handling of 'paranoid' attribute values from info.xml (paranoid='True' should also be allowed - currently only paranoid='true' works as expected). A simple patch (attached) addresses all these issues. /mkd Signed-off-by: Sol Jerome <sol.jerome@gmail.com>
* POSIX: Implement recursive attribute for nonexistent PathsSol Jerome2011-02-211-6/+30
| | | | | | | | The POSIX client tool now has the ability to recursively remove the contents of a specified directory provided there are no other managed entries under the directory. Signed-off-by: Sol Jerome <sol.jerome@gmail.com>
* POSIX: Remove client-side support for old POSIX typesSol Jerome2010-10-181-308/+328
| | | | Signed-off-by: Sol Jerome <sol.jerome@gmail.com>
* Client Tools: Pylint/PEP8 fixesSol Jerome2010-10-171-3/+10
| | | | Signed-off-by: Sol Jerome <sol.jerome@gmail.com>
* Group paths to prune as an elementTim Laszlo2010-09-261-1/+4
| | | | | | | Avoids a potential problem where paths with a : in the name are not removed. git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@6071 ce84e21b-d406-0410-9b95-82705330c041
* debian: Merge in changes from Arto JantunenSol Jerome2010-08-111-1/+2
| | | | | | | | | bcfg2.init: Remove agent mode (no longer exists) POSIX.py: Fix hardcoded errno value Signed-off-by: Sol Jerome <sol.jerome@gmail.com> git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@6005 ce84e21b-d406-0410-9b95-82705330c041
* POSIX: Don't install incompletely specified directory entries (Resolves ↵Sol Jerome2010-06-161-1/+9
| | | | | | | | Ticket #884) Signed-off-by: Sol Jerome <sol.jerome@gmail.com> git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5940 ce84e21b-d406-0410-9b95-82705330c041
* POSIX: Don't set perms for unspecified entries (Resolves ticket #893)Sol Jerome2010-06-161-0/+8
| | | | | | | | | | We were previously setting permissions to '0000' for entries that were incorrectly specified (missing 'perms' attribute). This fixes that and requests the user run bcfg2-repo-validate. Signed-off-by: Sol Jerome <sol.jerome@gmail.com> git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5939 ce84e21b-d406-0410-9b95-82705330c041
* Updated files to match PEP 257Fabian Affolter2010-06-071-24/+24
| | | | git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5897 ce84e21b-d406-0410-9b95-82705330c041
* POSIX: Add support to properly verify new POSIX entries (directories)Sol Jerome2010-03-221-1/+2
| | | | | | Signed-off-by: Sol Jerome <solj@ices.utexas.edu> git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5787 ce84e21b-d406-0410-9b95-82705330c041
* Remove duplicate definitions (reported by zed on irc) [bugfix]Sol Jerome2010-02-101-8/+0
| | | | | | Signed-off-by: Sol Jerome <solj@ices.utexas.edu> git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5719 ce84e21b-d406-0410-9b95-82705330c041
* POSIX: Use tag name in interactive mode to prevent confusionSol Jerome2009-11-241-1/+1
| | | | | | | Signed-off-by: Sol Jerome <solj@ices.utexas.edu> git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5594 ce84e21b-d406-0410-9b95-82705330c041
* POSIX: Remove support for old-style posix entriesSol Jerome2009-11-191-5/+0
| | | | | | | | | | | This commit forces the user to specify <Path> entries on the server side while still maintaining compatibility with old clients via the POSIXCompat plugin. Signed-off-by: Sol Jerome <solj@ices.utexas.edu> git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5582 ce84e21b-d406-0410-9b95-82705330c041
* POSIX: File file comparison in cases where unicode mismatches occur ↵Narayan Desai2009-10-301-1/+0
| | | | | | (Resolves Ticket #772) (Patch from Nicolas Dandrimont) git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5514 ce84e21b-d406-0410-9b95-82705330c041
* POSIX: Add support for all new POSIX types in the client codeSol Jerome2009-10-161-3/+48
| | | | | | | | | | | The client should now understand old and new POSIX entries. It is compatible with 0.9.6, 1.0 using POSIXCompat, and new 1.0 Path entries. Signed-off-by: Sol Jerome <solj@ices.utexas.edu> git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5485 ce84e21b-d406-0410-9b95-82705330c041
* Fix incorrect mappings and change configfile type to fileSol Jerome2009-10-161-1/+1
| | | | | | | Signed-off-by: Sol Jerome <solj@ices.utexas.edu> git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5484 ce84e21b-d406-0410-9b95-82705330c041
* Add bcfg2.conf option so that client can always run in paranoid modeSol Jerome2009-10-141-2/+3
| | | | | | | | | | | You currently must specify the -P command line option in order to run the client in paranoid mode. In order to allow for consistent usage (as specified in ticket #763), this commit adds an option to bcfg2.conf so that the client will always be run in paranoid mode. Signed-off-by: Sol Jerome <solj@ices.utexas.edu> git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5482 ce84e21b-d406-0410-9b95-82705330c041
* POSIX: Add block/character/fifo devices (ticket #477)Sol Jerome2009-10-011-12/+89
| | | | | | | | | | This commit adds support for posix device types via Path entries in Bundler. The 'type' attribute for Path entries is now all lowercase. Signed-off-by: Sol Jerome <solj@ices.utexas.edu> git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5470 ce84e21b-d406-0410-9b95-82705330c041
* POSIX: Add support for nonexistent Path entry typesSol Jerome2009-09-261-5/+25
| | | | | | | | | | Allow specification of Path entries which should not exist on the client. This gives the user the ability to explicitly remove Path entries if they exist on the client. Signed-off-by: Sol Jerome <solj@ices.utexas.edu> git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5464 ce84e21b-d406-0410-9b95-82705330c041
* POSIXCompat: Change name of Compat plugin to POSIXCompatSol Jerome2009-09-091-6/+5
| | | | | | Signed-off-by: Sol Jerome <solj@ices.utexas.edu> git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5425 ce84e21b-d406-0410-9b95-82705330c041
* POSIX: Add hard link support for ticket #588Sol Jerome2009-09-071-5/+47
| | | | | | | | Add support for HardLink entries using the new unified POSIX interface. Signed-off-by: Sol Jerome <solj@ices.utexas.edu> git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5417 ce84e21b-d406-0410-9b95-82705330c041
* POSIX: Replace incorrect SymLinksSol Jerome2009-09-071-5/+11
| | | | | | | | | | We were ignoring existing symlink entries even though they were incorrect. This commit adds the ability for the client to check for incorrect symlinks and replace them if they exist. Signed-off-by: Sol Jerome <solj@ices.utexas.edu> git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5415 ce84e21b-d406-0410-9b95-82705330c041
* POSIX: Add support for unified Path entriesSol Jerome2009-09-071-5/+11
| | | | | | | | | | | This commit adds support for a new Path entry which unifies all the various POSIX entry types. A new plugin is included which will allow you to transform new Path entries back into their old format (for compatibility with old clients). Signed-off-by: Sol Jerome <solj@ices.utexas.edu> git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5414 ce84e21b-d406-0410-9b95-82705330c041
* POSIX: Add client side support for Path entriesSol Jerome2009-08-171-1/+13
| | | | | | Signed-off-by: Sol Jerome <solj@ices.utexas.edu> git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5411 ce84e21b-d406-0410-9b95-82705330c041
* POSIX: Fix traceback with ConfigFile encoding errors (Ticket #705)Sol Jerome2009-08-171-1/+6
| | | | | | | Signed-off-by: Sol Jerome <solj@ices.utexas.edu> git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5410 ce84e21b-d406-0410-9b95-82705330c041
* Client tools: Remove unnecessary extra whitespaceSol Jerome2009-08-161-4/+4
| | | | | | Signed-off-by: Sol Jerome <solj@ices.utexas.edu> git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5408 ce84e21b-d406-0410-9b95-82705330c041
* Paranoid mode: Make paranoid mode more versatile/configurableSol Jerome2009-07-181-1/+33
| | | | | | | | | | | | | | | | | This commit adds a new [paranoid] section in bcfg2.conf. This allows you to specify a backup path other than the default as well as set a maximum number of copies to keep around. You are now allowed multiple backup copies, which are marked with a timestamp. This should help to prevent accidental deletion when running in paranoid mode multiple times. The paranoid section currently looks something like this: [paranoid] path = /my/custom/backup/path max_copies = 5 Signed-off-by: Sol Jerome <solj@ices.utexas.edu> git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5345 ce84e21b-d406-0410-9b95-82705330c041
* POSIX.py: Fix false error in InstallSymLinkSol Jerome2009-07-161-13/+14
| | | | | | | | | | We were falsely assuming that the path to the symlink existed when installing a new one. However, if a symlink has not yet been created, this path could simply not yet exist. Signed-off-by: Sol Jerome <solj@ices.utexas.edu> git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5331 ce84e21b-d406-0410-9b95-82705330c041
* Improve error message for attempted directory unlinks (Patch from Torsten ↵Narayan Desai2009-06-141-0/+3
| | | | | | Rehn) (Resolves Ticket #657) git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5277 ce84e21b-d406-0410-9b95-82705330c041
* Display diff in interactive mode (for Ticket #526)Sol Jerome2009-05-121-9/+13
| | | | | | Signed-off-by: Sol Jerome <solj@ices.utexas.edu> git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5221 ce84e21b-d406-0410-9b95-82705330c041
* Python 2to3 updates for the Client toolsSol Jerome2009-04-241-24/+49
| | | | | | Signed-off-by: Sol Jerome <solj@ices.utexas.edu> git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5178 ce84e21b-d406-0410-9b95-82705330c041
* pylint fixes for client codeNarayan Desai2008-12-081-1/+1
| | | | git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4991 ce84e21b-d406-0410-9b95-82705330c041
* Spelling fixesSol Jerome2008-11-261-3/+2
| | | | git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4987 ce84e21b-d406-0410-9b95-82705330c041