summaryrefslogtreecommitdiff
path: root/lib/ansible/module_utils/basic.py
Commit message (Collapse)AuthorAgeFilesLines
* only set executable from shell if not set alreadyBrian Coca2017-05-221-2/+3
|
* enable run_command to use non /bin/sh shellsBrian Coca2017-05-221-9/+17
| | | | fixes #24169
* Fix UnboundLocalError in basic.pyAbhijeet Kasurde2017-05-151-1/+1
| | | | | | | | | | * Fix for UnboundLocalError while accessing deprecations in result * Add Unit test Fixes #24592 Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
* Fix error in unittestingToshio Kuratomi2017-05-031-4/+3
| | | | | | When unittesting, the framework creates a pipes module that is picked up by the basic module_utils test. Switch to using shlex_quote as that is the right thing to use for portability anyway.
* Fix places where path needs to be bytes on python3Toshio Kuratomi2017-05-031-4/+12
| | | | | These were discovered on python3 with fetch code that fails on errors. Probably could be provoked with particular sets of arguments to stat as well.
* fix hashing when path is symlinkBrian Coca2017-04-201-1/+1
|
* Fix errors reported by pylint. (#23282)Matt Clay2017-04-061-1/+1
| | | | | | | | | * Fix pylint misplaced-bare-raise errors. * Fix pylint return-in-init error. * Fix pylint bad-format-character error. * Fix pylint too-many-format-args errors. * Fix pylint too-few-format-args errors. * Fix pylint truncated-format-string error.
* changed spec to options as per irc meetingBrian Coca2017-03-281-2/+2
|
* pass params to validate againstBrian Coca2017-03-241-17/+23
|
* subspec protptypeBrian Coca2017-03-241-8/+26
|
* E501 fixes (#22879)Matt Martz2017-03-221-4/+9
|
* E1 legacy pep8 fixes (#21933)Matt Martz2017-03-211-5/+5
| | | | | | * E1 pep8 fixes * e111 fix for rds.py
* added 'existing' backBrian Coca2017-03-201-0/+2
| | | | fixes #22785
* Check if file is not a directory with get_bin_path function (#13985)THEBAULT Julien2017-03-101-1/+1
|
* Change comment to reflect the actual codeViktor Fogelberg2017-03-031-1/+1
|
* Ensure that filenames from archives are not expandedDag Wieers2017-03-021-28/+36
| | | | This fixes #21795
* Fix log_invocation function to pass unittests on python3Toshio Kuratomi2017-03-011-8/+1
| | | | | | Normalize this function to use native strings. Native strings won't display an extra "u" or "b" character to denote py2 unicode or py3 bytes types.
* PEP8 E712 fixes (#21916)Matt Martz2017-02-241-1/+1
|
* refine password field filtering (#21230)Brian Coca2017-02-161-3/+5
| | | | | | | | * refine password field filtering * dont skip * removed bad leftover vestige of previous condition
* Don't mix deprecations messages with warnings messages (#21337)Pilou2017-02-131-3/+6
| | | | | | | | | | * Remove unused attribute '_passthrough' * Don't mix deprecations with warnings * Return values: add 'deprecations' key used internally * 'deprecations' and 'warnings' return values: add tests
* fixed bad copy/paste, deprecations should deprecateBrian Coca2017-02-131-1/+1
|
* Fix to bytes surrogate and nonencodable chars (#21180)Toshio Kuratomi2017-02-091-2/+2
| | | | | * Add a surrogate_then_replace error strategy to keep to_bytes from tracebacking by default * Port all code that explicitly used surrogate_or_replace to surrogate_then_replace
* use regex vs list to weed out password fieldsBrian Coca2017-02-091-2/+6
| | | | | | - also warn as module SHOULD have no_log - make password regex exportable for testing - avoids boolean fields
* updates the code path for network modules (#21193)Peter Sprygada2017-02-091-1/+5
| | | | | | | * replaces persistent connection digest with _create_control_path() * adds _ansible_socket to _legal_inputs in basic.py * adds connection_user to play_context * maps remote_user to connection_user when connection is local * maps ansible_socket in task_vars to module_args _ansible_socket if exists
* add url_password to 'cleanse' listBrian Coca2017-02-091-1/+1
|
* removing unwanted variables and using to_native instead of str()jerry2017-02-081-2/+2
| | | | (cherry picked from commit c4b09cbcb4df160509f44ffddfedf586391b6878)
* Adding self.log() on IOErrors and OSErrrosjeronimog2017-02-081-0/+2
| | | | (cherry picked from commit ef1ecfd2c28412531fc7e0482b66dab92226306f)
* module_utils: implement deprecation warning for params (#20884)René Moser2017-02-011-6/+14
| | | | | | | | * module_utils: implement deprecation warning for params * rename deprecated_version to removed_in_version * fix pep8 E121
* module_utils/basic.py: Support logical or condition in required_if (#20220)Ganesh Nalawade2017-01-311-2/+14
| | | | | | | | | | | | | * Support logical or condition in required_if Add logical 'or' condition support in 'required_if' for requirements. * If requirements is a list all parameters within it should be present. * If requirements is a set atleast one parameter should be present * Fix review comment
* Show valid bool symbols in error for invalid bool symbolAdrian Likins2017-01-311-2/+3
|
* added warnings list to module and autoaddBrian Coca2017-01-311-11/+55
| | | | | | | | | added better way of adding warnings to return data backwards compatible if warnings key already exists added deprecations made iface more generic changed to enforce type per item added logging of warnings/deprecations also display deprecations by default
* PEP 8 E111 & E114 cleanup. (#20838)Matt Clay2017-01-301-1/+1
|
* PEP 8 indent cleanup. (#20800)Matt Clay2017-01-291-33/+33
| | | | | | | | * PEP 8 E121 cleanup. * PEP 8 E126 cleanup. * PEP 8 E122 cleanup.
* PEP 8 cleanup. (#20789)Matt Clay2017-01-281-4/+7
| | | | | | | * PEP 8 E703 cleanup. * PEP 8 E701 cleanup. * PEP 8 E711 cleanup. * PEP 8 W191 and E101 cleanup.
* Fix for atomic_move on RHEL5Toshio Kuratomi2017-01-041-16/+9
| | | | | | | | | | | | | | | | | | | When becoming an unprivileged user using non-sudo on a platform where getlogin() failed in our situation we were not able to detect that the user had switched. This meant that all of our logic to use move vs copy if the user had switched was attempting the wrong thing. This change tries the to do the right thing but then falls back to an acceptable second choice if it doesn't work. The bug wasn't easily detected because: * sudo was not affected because sudo records that the user's have been switched so we were able to detect that. * getlogin() works on most platforms. RHEL5 with python-2.4 seems to be the only platform we still care about where getlogin() fails for this case. * It had to be becoming an unprivileged user. When becoming a privileged user, the user would be able to successfully perform the best case tasks.
* fixed id queries, should rely on effectiveBrian Coca2017-01-041-3/+3
|
* Add traceback information to fail_json in atomic moveToshio Kuratomi2017-01-031-5/+5
|
* let chdir support relative path in more modules (#16736)Gordon Gao2016-12-221-4/+2
|
* added file flag preservation to atomic_moveBrian Coca2016-12-211-0/+14
| | | | preserves existing flag info if possible
* simplified unsafe writesBrian Coca2016-12-201-19/+15
|
* unique error messages to avoid confusionBrian Coca2016-12-201-4/+3
|
* Fix 3 char indent on AnsibleModule._unsafe_writes (#19542)Adrian Likins2016-12-201-20/+20
|
* Better error msg for basic.get_bin_path()Adrian Likins2016-12-191-1/+1
| | | | Include the searched paths in the error message.
* Better error message for module unsupported paramsAdrian Likins2016-12-191-2/+6
| | | | | | Keep track of all the unsupported parameters, and include all of them in the error message as well as a list of the supported params.
* Factored polling std{out,err} reads into a functionSteve Kuznetsov2016-12-141-12/+13
| | | | | | | | The process to poll for data in the stdout and/or stderr pipes during a low-level command execution was repetitive. Factoring this out into a function DRYs out the code. Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
* Removed dict.iteritems() in several other files.Andrea Tartaglia2016-12-141-1/+1
| | | | This is for py3 compatibility #18506
* log on target based on nolog, not verbosity (#18570)Brian Coca2016-11-291-1/+2
| | | | | | | | | | | * log on target based on nolog, not verbosity fies #18569 * initialize module name removing verbosity exposed missing name at certain stages, initialize to file name and update later once module args are parsed
* Fix traceback in atomic_move (#18649)Adrian Likins2016-11-281-3/+5
| | | | | | | | | | | Commit 8b08a28c895666b9fc673e5bf26bd91b2be77fe6 removed a call to get_exception() that was needed. Without it, the fail_json references an undefined variable ('exception') and throws an exception. Add the get_exception() back in where needed and update references. Now the proper module failure is returned. Fixes #18628
* File attributes (#18213)Brian Coca2016-11-071-1/+92
| | | | | | | | * added attributes to base file params * dont change attributes when none * fixed test to deal with new attributes
* Add hint that python3 might be too oldToshio Kuratomi2016-10-271-1/+9
| | | | | | | | This limitation of python-3.4 mkstemp() is the final reason we made python-3.5 our minimum version. Since we know about it, give a nice error to the user with a hint that Python3.4 could be the issue. Fixes #18160