Commit graph

610 commits

Author SHA1 Message Date
Brian Maddy
3b0bc3e79e typo in stat.executable (was stat.excutable) (#4886)
I didn't actually run this because it's so simple, but it seems correct.
2016-09-16 18:48:21 -04:00
Dag Wieers
c776932ca3 Don't add included files as arguments on the command line (#4626)
This means we will have to unarchive the complete archive if a single change is found.
Unfortunately we cannot fix this for `unzip`, the only hope is a pure-python reimplementation.

This fixes problems reported in the comments of #3810
2016-09-12 07:47:45 +02:00
Dag Wieers
1cda0b1819 Ensure unicode characters in zip-compressed filenames work correctly (#4702)
* Ensure unicode characters in zip-compressed filenames work correctly

Another corner-case we are fixing hoping it doesn't break anything else.

This fixes:
- The correct encoding of unicode paths internally (so the filenames we scrape from the output and is returned by zipfile match)
- Disable LANG=C for the unzip command (because it breaks the unicode output, unlike on gtar)

* Fix for python3 and other suggestions from @abadger
2016-09-09 09:26:19 -07:00
Brian Coca
1d4c0abe29 added backup_file to module returns (#4723)
fixes #14502
also cleaned up some unused stuff and fixed imports
2016-09-07 12:18:33 -04:00
Dag Wieers
dfb170cab9 Support DOS file attributes (e.g. archive-bit or hidden-bit) (#4705)
This fixes #4554
2016-09-06 10:30:47 -07:00
Evan Kaufman
f7b34c810a Declare empty diff dict ahead of time (#4646)
Fixes #4634
2016-09-02 20:55:03 +02:00
Toshio Kuratomi
42c74a0ce2 Python3 fixes to copy, file, and stat so that the connection integration tests can be run (#4632)
* Python3 fixes to copy, file, and stat so that the connection integration tests can be run

* Forgot to audit the helper functions as well.

* Fix dest to refledt b_dest (found by @mattclay)
2016-09-02 11:25:31 -07:00
Toshio Kuratomi
7e79c59d38 to_text, to_bytes, and to_native now have surrogate_or_strict error handler (#4630)
On python3, we want to use the surrogateescape error handler if
available for filesystem paths and the like.  On python2, have to use
strict in these circumstances.  Use the new error strategy for to_text,
to_bytes, and to_native that allows this.
2016-09-01 04:19:15 -07:00
Evan Kaufman
5728ef89f0 Implemented file content diff for replace module (#4479) 2016-08-30 11:56:35 +02:00
James Pharaoh
5bce0049a1 fix error in documentation for stat checksum (#4582) 2016-08-27 21:25:26 -04:00
Gennady Trafimenkov
6ac58a5832 Clarify what checksum algorithm is used by copy modules (#4198) 2016-08-27 17:11:17 +02:00
Toshio Kuratomi
4912ec30a7 Fixes for lineinfile (#4553)
Lineinfile deals heavily with Unic text files.  Makes some sense to deal
with it all as byte strings.  So there is a lot of work done here to
show that we're dealing with byte strings throughout.
2016-08-26 01:05:53 -07:00
Dag Wieers
9ea56d26b0 Fix multiple issues with unzip and gtar support (#4131)
* Improve the correct handling of gtar and unzip options

Add the option --show-transformed-names when extra_opts is being used
Ignore bogus warnings related to empty filenames
Properly quote _and_ escape filenames for unzip command
Rewrite gtar options and provide run_command with array, not string

This fixes #2480 and #4109.

* Make check-mode work for zip-files

Check-mode was disabled for zip-files since gtar did not support it.
This change enables check-mode support for zip-files, but does skip the task when used with gtar.
(Best of both worlds)

Also remove unused compress_mode variable.

This replaces PR #4401, the changes overlap somewhat so I merged them
2016-08-25 14:25:21 +01:00
Michael Scherer
f6450e577f Add acl freebsd (#3656)
* FreeBSD do not support --omit-header and --absolute-names

* The option for following symlink wth getfacl is different on FreeBSD

* ZFS on Freebsd use nfsv4 acls, who use a slightly different syntax

* FreeBSD do not have a --test flag, so always return 'True'

* FreeBSD do not have the --omit-headers options, so we have to filter by ourself

* Mark Freebsd as working for the acl module
2016-08-23 11:11:34 -04:00
Toshio Kuratomi
90673cf6db Refactor stat.py so that it would be more friendly for unittests. (#4462)
* Refactor stat.py so that it would be more friendly for unittests.

* PEP8ify since we're moving most of the lines in the file and there's no open PRs
2016-08-18 13:16:06 -07:00
Chris Short
013e91e9b0 find.py: Editing contains description to say regex (#4452)
find module contains argument appears to accept regex; correcting description accordingly
2016-08-17 11:53:05 -04:00
Lucas Costa Beyeler
5559e6a669 Fix #4202: Can't unarchive remote files (#4244)
When you try to remote unarchive files with the option copy=no the code always fail, as evidenced in issue #4202. That happens because the conditional to check "if remote_src=no or copy=yes" will always be true since the default value of them is remote_src=no and copy=yes.
My modification is only to change the condition from or to and, that way only if both the vars stay with the default value will be true, otherwise you can unarchive remote files.
2016-08-11 11:23:29 -07:00
Dag Wieers
4fddb21980 Improve the documentation (#4385)
Improvements to make it more clear that pure compressed files (.gz, .bz2 and .xz) files are not supported.

This improves on #3241.
2016-08-11 08:53:37 -04:00
Sam Doran
06e9dc5236 Improve regexp for matching file permissions (#4306)
A capital "S" appears when the the setuid or setgid bit are set but have no effect. Likewise, a capital "T" appears when the sticky bit is set but it has no effect.
2016-08-10 23:54:29 +02:00
Brian Coca
9dde201d87 unsafe writes! (#4314)
* unsafe writes!

* moved unsafe_write docs and args to file common

* added unsafe_writes option handling
2016-08-09 12:39:25 -04:00
Toshio Kuratomi
5d7b46e0dd Be explicit about specifying the ssh port if it was user specified (#4302)
Previously, if the port specified by the user or inventory was 22, then
the ssh client port would be used instead.

Fixes #3895
2016-08-08 08:59:25 -07:00
peter.jang
caaa8e282e fix for rsync protocol (#4211) 2016-08-02 14:34:41 -04:00
David Chwalisz
afff84321d file module: add clarification on state=absent re files that do not exist. 2016-08-01 15:16:52 -04:00
Brian Coca
7de287237f stop trying to set permissions in check mode
fixes #4195
2016-07-15 11:43:05 -04:00
Ryan S. Brown
3a04ec5a70 Indent unarchive module documentation to fix parsing error. 2016-07-14 14:05:00 -04:00
James Cammarata
bfeab3ae1a Merge branch 'feature_10218' into devel 2016-07-14 12:14:54 -05:00
tobixx
3139b90f7e added read-/write-/executeable flags for invoking user (#4130) 2016-07-14 19:11:35 +02:00
James Cammarata
467516e5da Add remote_src param for unarchive to deprecate copy param
From ansible/ansible#10218
2016-07-14 11:24:23 -05:00
Dag Wieers
37b7708c5d Fix a problem where the newly provided mode is a string (#3769)
* Fix a problem where the newly provided mode is a string

This fixes #3597

* Implement python3-compatible get_exception() handling
2016-07-06 15:16:51 -07:00
Dag Wieers
b66bf8e7a4 Revert PR #3575 since it causes problems related to exclude patterns (#3767)
* Revert PR #3575 since it causes problems related to exclude patterns

By using a different method for getting archive filelists, and extracting we introduced new problems related to excluding based on gtar patterns.

As a result files that would be excluded by gtar, would still be in the filelist. Implementing our own gtar compatible pattern exclusion mechanism is near to impossible (believe me, we looked at it...). The best way is to look at the original problem and deal with that, and ensure that extraction and filelists are done with the exact same tool and exact same options.

The solution is to decode the octal unicode representation in gtar's output back to unicode. Since gtar has no problem extracting these files in LANG=C, we simply has to compensate for it.

This reverts #3575 and fixes #11348.

* Implement codecs.escape_decode() instead of decode("string_escape") for python3
2016-07-06 14:40:48 -07:00
Lukas Grossar
49bf8de27c also match on tabs in ini_file (fixes #106) (#4067)
also match on tabs in ini_file
2016-06-30 18:15:49 -04:00
Toshio Kuratomi
41adb78cab A few more sanity checks for detecting unzip output that's not a file entry (#3982)
* A few more sanity checks for detecting unzip output that's not a file entry

Also note that there's a rounding error somewhere in the mtime
comparison code.

* Fix reference to sub-array
2016-06-27 13:18:12 -07:00
Keisuke Kamada
74864c2d85 Do not copy file if running on check mode 2016-06-17 02:19:52 +09:00
Brian Coca
949916a155 restored incorrectly removed docs, jinja2 override 2016-06-15 17:01:46 -04:00
neo
606598a857 fix unarchive doesn't extract changed tar file #3901 2016-06-10 17:35:08 -04:00
Matt Fischer
1f5335d5e0 Update delete notes for Synrhconize docs (#3723)
The example for delete=yes does not specify recursive although it is
required. In addition, the wording for the delete option is confusing
about from where files are really deleted. This should clarify that.
2016-06-10 15:11:24 -04:00
Dag Wieers
3f7a935932 Improve the unzip output scraping (#3819)
* Improve the unzip output scraping

Ensure we capture the complete file (also when it includes spaces).
Drop lines that do not conform (in length) to what we expect (e.g. header/footer).

This fixes #3813

* Fix how split() works
2016-06-10 11:05:22 -04:00
Brendan Jurd
6448204271 Fix grammar in docs for fetch 'fail_on_missing' (#3872) 2016-06-06 15:27:18 -04:00
Brian Coca
b8598748bc Revert "Add prefixing and suffixing fuctionality to assemble"
This reverts commit 4c386dba56.
keeping in sync with main repo revert
2016-06-01 15:10:08 -04:00
Matthias Frey
d3a9a90d2d Fixed error in assemble module when validation failed. (#3814)
Error was: TypeError: fail_json() takes exactly 1 argument (2 given)
2016-06-01 09:19:58 -04:00
Chris Houseknecht
ca4365b644 Merge pull request #901 from underyx/assemble-with-prefix-and-suffix
Add prefixing and suffixing fuctionality to assemble module
2016-05-31 18:15:57 -04:00
Bence Nagy
4c386dba56 Add prefixing and suffixing fuctionality to assemble 2016-05-31 14:47:20 -07:00
Jan Fader
7c08f10900 fix for #3706 (#3778) 2016-05-29 06:52:18 -07:00
Dag Wieers
9f973aefb1 Add unpack results to error output, for debugging purposes on failure
This may help understand what is going on with #3631
2016-05-26 18:43:22 -07:00
Toshio Kuratomi
ca4140134d Python2.4's zipfile library cannot handle zip 64bit extensions which are needed for > 64K files (#3754)
Fallback to unzip if zipfile fails and hope that unzip can deal with it
(sites have an easier time upgrading the unzip utility than all of
python).

https://bugs.python.org/issue3997

Fixes #3560
2016-05-26 16:40:50 -07:00
Marcos Diez
9e197a5f78 The documentation of lineinfile now makes reference to blockinfile (#3639) 2016-05-24 14:49:09 +02:00
Michael Scherer
69ea617093 Convert the whole files/ directory to py3 syntax (#3685) 2016-05-18 07:01:53 -07:00
Michael Scherer
de6cdeeba6 Testing the module on freebsd fail, since module is not assigned yet 2016-05-17 00:22:08 +02:00
Michael Scherer
2449267d42 Fix the argument for acl module (#3653) 2016-05-16 14:00:15 -04:00
Dag Wieers
83a3c45a7d Fix small typo (#3642) 2016-05-13 13:10:35 -04:00