Commit Graph

634 Commits (d9ff373cec5ecd3bc90c021dd746e552aedac99b)

Author SHA1 Message Date
Brian Coca 75411fa9e3 Revert "stat: doc: add version for new returns" 9 years ago
Brian Coca 88f1e67b1f added file flags/attributes to stat (#5358)
depends on http://github.com/ansible/ansible/issue/18213
also documented return version of fields added in 2.2
added get_mime to keep consistency
changed default mime behaviour
9 years ago
Gyorgy Szombathelyi 4863335cfa Ini_file: fix regression with the create option
The new create option with the default value 'no' changes the
behavior from the previous Ansible releases. Change the default to
'yes' to create missing ini files by default.

Fixes: #5488
9 years ago
René Moser 8c762d7b02 stat: doc: add version for new returns (#5594) 9 years ago
Michael Herold eac46e609c Removes outdated "requirement" and outdated "note" (#5332)
- 7f59773460 no longer uses `ConfigParser`
- 1d4c0abe29 removed the `import` statement
9 years ago
zuiurs cb1d90ccfd fix the behavior that the dest is directory
This fixes the behavior that the dest is directory,
when we set the "force: no" argument.
To be join the dest and the src's basename,
before checking the "force" argument.
9 years ago
bencomp 48cd199871 Make find return sample a YAML dict
In the description of the find module return value, the sample dict
has its key=value strings converted to key=value: None in the
web documentation. This commit updates the sample output to a 'real'
dict.

Minor additional edit in the description: "return list *of* files".
9 years ago
scottb 06d0987848 Merge pull request #5354 from tima/docs-sychronize
clarifies synchronize module docs
9 years ago
Evan Kaufman 087ba94e6b Exposed backup file path, simplified result args (#5364)
Fixes #245
9 years ago
Luca Berruti 9c766a9f88 ini_file: return more infos on changes. 9 years ago
Luca Berruti a5e6e4a134 ini_file: diff support. 9 years ago
Luca Berruti 486bedb5e5 ini_file: add create= option. 9 years ago
Luca Berruti 15d62dc17f ini_file: fixes #1788, fails --check when file doesn't exist. 9 years ago
Brian Coca 52e0536fae refactor stat
make format function 'format only'
added platform dependant info, when it is available
avoid rechecking same info
added comments to each info gathering section

(cherry picked from commit a79acf73d7eb79b76d808ff8a1d6c505dfd9ec82)
9 years ago
Charles Zaffery 952ad58bda Remove line when 'state: absent' with 'option:' instead of commenting 9 years ago
Timothy Appnel 38b5a66b7a clarifies synchronize module on use of --delayed-updates 9 years ago
Michael Scherer 953cd915bb Cleanup imports of xattr
Since the module use re and os, we need to import them.
And rather than importing '*', we should limit to the
only object/function needed, so we can more easily refactor
later.
9 years ago
Michael Scherer 15f8c6835b Fix unarchive on python3
Since handler.files_in_archive is a list of files coming from
various executables output, that's a bytes list, and we use it
with dest who is a str. So we need to convert that to native
type.
9 years ago
John R Barker 312f578f93 Bulk spelling improvement to modules-core (#5225)
* Correct spelling mistakes

* Correct more spelling issues

* merge conflict

* Revert typo in parms
9 years ago
Toshio Kuratomi e4c5a13a7a Fix assemble module for python3 9 years ago
Matt Clay 0a7ebef14e Detect tar type (bsd, gnu) and only use gnu tar. (#4352)
* Detect tar type (bsd, gnu) and only use gnu tar.

* Revert return code checking for TgzArchive.
9 years ago
Andrew Gaffney 622ae9c67e Match existing INI file entry with leading whitespace (fixes #4997) (#4998) 9 years ago
JesseEmond 1f741b69f4 Unarchive stop passing file mode to tar command (#4179)
Fixes #4063.

Tar does not use this parameter on extraction (-x) or diff (-d)(the
only two cases where it is passed in unarchive). It only uses it on
creation:
https://www.gnu.org/software/tar/manual/html_section/tar_33.html

Providing `unarchive` with a file mode of `0755` (octal) makes it pass
the argument `--mode 493` (493 = 0755 in decimal) to `tar`, which then
fails while verifying it (because it contains an invalid octal char
'9'). Not passing the parameter to tar solves the issue.
9 years ago
nichivo 8886afd145 Insert missing option line before blank lines (#4747) 9 years ago
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.
9 years ago
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
9 years ago
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
10 years ago
Brian Coca 1d4c0abe29 added backup_file to module returns (#4723)
fixes #14502
also cleaned up some unused stuff and fixed imports
10 years ago
Dag Wieers dfb170cab9 Support DOS file attributes (e.g. archive-bit or hidden-bit) (#4705)
This fixes #4554
10 years ago
Evan Kaufman f7b34c810a Declare empty diff dict ahead of time (#4646)
Fixes #4634
10 years ago
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)
10 years ago
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.
10 years ago
Evan Kaufman 5728ef89f0 Implemented file content diff for replace module (#4479) 10 years ago
James Pharaoh 5bce0049a1 fix error in documentation for stat checksum (#4582) 10 years ago
Gennady Trafimenkov 6ac58a5832 Clarify what checksum algorithm is used by copy modules (#4198) 10 years ago
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.
10 years ago
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
10 years ago
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
10 years ago
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
10 years ago
Chris Short 013e91e9b0 find.py: Editing contains description to say regex (#4452)
find module contains argument appears to accept regex; correcting description accordingly
10 years ago
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.
10 years ago
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.
10 years ago
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.
10 years ago
Brian Coca 9dde201d87 unsafe writes! (#4314)
* unsafe writes!

* moved unsafe_write docs and args to file common

* added unsafe_writes option handling
10 years ago
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
10 years ago
peter.jang caaa8e282e fix for rsync protocol (#4211) 10 years ago
David Chwalisz afff84321d file module: add clarification on state=absent re files that do not exist. 10 years ago
Brian Coca 7de287237f stop trying to set permissions in check mode
fixes #4195
10 years ago
Ryan S. Brown 3a04ec5a70 Indent `unarchive` module documentation to fix parsing error. 10 years ago
James Cammarata bfeab3ae1a Merge branch 'feature_10218' into devel 10 years ago