Commit Graph

544 Commits (087931546dfd6a8c07b0143dd7d0ac3c16a789d7)

Author SHA1 Message Date
Till Maas 898a38b074 module_utils/atomic_move(): Use tempfile module
Fix a potential race condition by using the tempfile module.
12 years ago
Till Maas 8f778a83df module_utils/atomic_move(): Restore owner/group
Manually restore owner and group if both src and dest are on a separate
file system.
12 years ago
James Tanner 67517e96d3 Fixes #6567 put the git wrapper script in the module temp dir 12 years ago
James Cammarata 3f5440f7df Make modules set a valid working directory
Fixes #6546
12 years ago
Brian Coca 2d25577e11 Fixes and cleanup to file functions and module
- unified set attribute functions ... not sure why 2 identical functions
exist with diff names, now there are 3 while i repoint all modules to 1
- fixed issue with symlinks being created w/o existing src when force=no
- refactored conditionals, simplified where possible
- added tests for symlink to nonexistant source, with both force options
- made symlink on existing attomic (force)
12 years ago
James Cammarata a0cb974575 Be sure to return to the old directory if cwd is set in run_command 12 years ago
James Tanner a348f67238 Reset the current directory after running subprocess.Popen 12 years ago
James Cammarata 677008bef7 Rejoin args list into a string for run_command when using an unsafe shell
This allows the use of an args list with leading environment variables,
which otherwise would fail due to the way Popen works.
12 years ago
James Cammarata 5233d4bc31 Fix typo in run_command when sending data that is not binary 12 years ago
James Cammarata b1a37dcc08 Revert "Rejoin args list into a string for run_command when using an unsafe shell"
This reverts commit 4273cb2d8e.
12 years ago
James Cammarata 4273cb2d8e Rejoin args list into a string for run_command when using an unsafe shell
This allows the use of an args list with leading environment variables,
which otherwise would fail due to the way Popen works.
12 years ago
James Cammarata 303e085f8b Only use cwd in run_command kwargs if the directory exists 12 years ago
James Cammarata 60a7f57300 Make sure the cwd exists in run_command before trying to use it 12 years ago
Dan Koch bbf320fd22 Work around for cwd stat problems with run_command and sudo
This fixes issue #6443
12 years ago
Michael DeHaan 6d841d120e Don't process shell commands as arrays. 12 years ago
Michael DeHaan cfabc2e28a module.run_command is intended to bypass the shell here, so can't do ">>" 12 years ago
Michael DeHaan 0b0ca95731 Expand environment variables and tildes passed to commands generically across the board. 12 years ago
James Tanner ba0fec4f42 Force command action to not be executed by the shell unless specifically enabled 12 years ago
James Cammarata 9730157525 Validate SSL certs accessed through urllib*
* Adds another module utility file which generalizes the
  access of urls via the urllib* libraries.
* Adds a new spec generator for common arguments.
* Makes the user-agent string configurable.

Fixes #6211
12 years ago
James Cammarata 2a0028e687 Sanitize run_command argument output
Fixes #6316
12 years ago
James Cammarata 3b2d409906 Fixing several bugs in assemble and updating tests
Bugfixes:
* the remote_src param was not being converted to a boolean correctly,
  resulting in it never being used by the module as the default behavior
  was remote_src=True (issue #5581)
* the remote_src param was not listed in the generic file params, leading
  to a failure when the above bug regarding remote_src was fixed
* the delimiter should always end with a newline to ensure that the file
  fragments do not run together on one line

Fixes #5581
12 years ago
James Cammarata b6222abee6 Fix unicode decode error in syslog for modules
Fixes #6056
12 years ago
Martin Thorsen Ranang 7e23ed345f Avoid breaking on unicode input when logging to syslog in modules
After commit 254f87e, non-ascii input broke logging to syslog.
12 years ago
James Cammarata 0cfaabf9cb Make sure unicode params don't break logging in modules 12 years ago
James Cammarata b8646991db Filter out messages that match the pattern username:password@host
This filtering is done in both the module invocation logging and in
the regular verbose() logging output.

Fixes #4087
12 years ago
James Cammarata 254f87e7dd Fix log handling of unicode output to syslog in modules 12 years ago
James Cammarata a023cbce14 When using jsonify in modules, try several unicode encoding for dumps()
Fixes #4821
12 years ago
James Tanner b3ab7e7885 Check mutually_exclusive parameters before applying defaults 12 years ago
James Cammarata 75e3b59bbd Adding no_log: capability for tasks
Fixes #4088
12 years ago
willthames 31f5ecea60 Allow float as an argument type in AnsibleModule 12 years ago
jctanner 301a1189dd Merge pull request #5122 from willthames/openlog_str
Make first argument to syslog.openlog be a string
12 years ago
Paulo Bittencourt fc3597af5d files/file: add support for symbolic permission modes 12 years ago
James Tanner bf78d8cf73 Addresses #5090 setup module was using path.is_file instead of path.isfile 12 years ago
Will Thames 76aca4d547 Make first argument to syslog.openlog be a string
syslog.openlog expects its first argument to be a string.
Without this change running under ipython fails.
12 years ago
dragon3 d39e6fda92 hostname module: add support for Amazon Linux 12 years ago
James Tanner 74e7eba528 Fixes #4506 test length of context before checking invalid indexes 12 years ago
James Tanner 898de833b0 Merge pull request #4413 from jerm/ansible
Add capability to pass in a PATH prefix to run_command and allow pip module
to utilize that to make virtualenv bin/ available in pip installs
12 years ago
James Tanner dc4d589ce0 Fixes #4767 detect hard links and set state in add_file_info 12 years ago
Michael DeHaan b1b5280075 Reapply pep8 changes from previous revert. 12 years ago
Michael DeHaan 465f3b1c91 This allows type=dict in a module to allow passing in a real dict or JSON. 12 years ago
Michael DeHaan d34a26e307 Undo an inadvertant revert from template changes so we still allow pythonic imports in module land. 12 years ago
James Tanner d154bf8781 Revert templating enhancements from 73dbab70 e6c28658 d409352c 9858b1f2 4587528b 9b1fe455 214b0b05 8d3db803 7f9504d1 5031104c 35cb9dc2 2bd8cb57 1e85c754 12 years ago
Michael DeHaan 54c902f102 Identation + misc PEP8 fixes. 12 years ago
Michael DeHaan 9858b1f2f3 Enable imports to work on a snippet based system, allowing for instance a library of common EC2 functions
to be reused between modules.  See library/system/service and library/system/ping for initial examples.  Can
work the old way to just import 'basic', or can import the new way to import multiple pieces of code from
module_utils/.
12 years ago