Commit Graph

582 Commits (e40e08d799e1e99101823d4f3ae9af5bc073862d)

Author SHA1 Message Date
Brian Coca 1a56a5c442 created debug method, renamed debug attribute to _debug 2015-10-01 10:17:41 -04:00
Toshio Kuratomi 4cfcf5d61b Merge pull request #12568 from mgedmin/py3k
Python 3: fix most tests for ansible.module_utils.basic
2015-09-30 12:47:29 -07:00
Trond Hindenes 94cfbe7ee9 Get-AnsibleParam 2015-09-30 21:02:12 +02:00
Marius Gedminas cc1e1648f5 Tweak comment style 2015-09-30 18:46:50 +03:00
Marius Gedminas 213029a21e Python 3: don't convert unicode to unicode 2015-09-30 18:46:49 +03:00
Marius Gedminas c7be004c19 Python 3 has no dict.iteritems()
(Reminder: cannot use six here, module_utils get shipped to remote
machines that may not have six installed -- besides six doens't support
Python 2.4.)
2015-09-30 18:46:49 +03:00
Marius Gedminas 9f3e5ceb14 Make sure 'basestring', 'bytes' and 'unicode' are defined
Python 3 doesn't have 'basestring' and 'unicode'.

Python 2.4 doesn't have 'bytes'
2015-09-30 18:40:47 +03:00
Brian Coca ddafed4403 Merge pull request #12528 from bcoca/task_logging
task logging revamp
2015-09-30 11:38:34 -04:00
Brian Coca 7b64126c9d pushed up openvz detection for cases of 'stacked' virtualization 2015-09-30 11:27:50 -04:00
Linus Unnebäck 45f9800754 facts: correctly detect docker inside a xen host 2015-09-30 17:08:21 +02:00
Konstantin Manna 4226e49bc6 bugfix: statement had no effect => statement now has assumed effect 2015-09-28 23:33:48 -04:00
Brian Coca 8d024c3747 Merge pull request #12472 from resmo/for_ansible
cloudstack: improvements and tests
2015-09-28 14:27:22 -04:00
Toshio Kuratomi 056a020357 Do not fail if /proc/uptime is not present
This can happen in chroot environments that don't have all of /proc
available
2015-09-26 10:00:28 -07:00
Brian Coca 37a918438b task logging revamp
* allow global no_log setting, no need to set at play or task level, but can be overriden by them
 * allow turning off syslog only on task execution from target host (manage_syslog), overlaps with no_log functionality
 * created log function for task modules to use, now we can remove all syslog references, will use systemd journal if present
 * added debug flag to modules, so they can make it call new log function conditionally
 * added debug logging in module's run_command
2015-09-25 23:57:28 -04:00
Brian Coca 191ae0831d fixed syntax error 2015-09-25 17:15:26 -04:00
Brian Coca 48412c13b2 fixed copy n paste typo on future code 2015-09-25 17:08:03 -04:00
Brian Coca 1c49e3b842 draft shared service code for modules, part of spliting service module 2015-09-25 11:26:21 -04:00
Toshio Kuratomi dcdcd9e9c5 Move is_executable to the toplevel of basic.py so we can utilize it from other code 2015-09-25 07:48:57 -07:00
Gerben Geijteman 4c20964475 Add Weekday (0-6) as a number and add weeknumber (00-52) 2015-09-24 15:05:44 +02:00
Marius Gedminas 2c4982b58d Python 3: there's no itertools.imap
Because the builtin map() acts like an iterator already.
2015-09-23 10:04:26 +03:00
Marius Gedminas 6708d56a21 Python 3: avoid long integer literals
Even Python 2.4 automatically promotes int to long.
2015-09-23 10:04:25 +03:00
Marius Gedminas f5d4935197 Python 3: treat python as a function in module_utils/basic.py
NB: we can't use 'from __future__ import print_function', but luckily
print(one_thing) works fine on both Python 2 and Python 3 without that.
2015-09-23 10:04:25 +03:00
Marius Gedminas e71a986e16 Python 3: avoid octal constants in module_utils/basic.py 2015-09-23 10:04:25 +03:00
Marius Gedminas d2bec7f81f Python 3: avoid "except ..., e:" in module_utils/basic.py
Make the code compatible with Pythons 2.4 through 3.5 by using
sys.exc_info()[1] instead.

This is necessary but not sufficient for Python 3 compatibility.
2015-09-23 10:04:25 +03:00
Rene Moser b43939dfd6 cloudstack: make tags handling idempotence
Credits to @jeffersongirao, who provided the patch.
2015-09-22 16:12:35 +02:00
Rene Moser efd122c2f0 cloudstack: add returns_to_int return handling into utils
It is not uncommon that the API returns string for int values e.g. ports in listFirewallRules or listPortForwardings,
2015-09-22 14:44:08 +02:00
Rene Moser c9a3801a25 cloudstack: common argument_spec and requried_together to utils 2015-09-22 14:36:43 +02:00
Brian Coca d27b73e7b5 fixed case in which boto3 is present but module is not using it yet 2015-09-21 15:16:07 -04:00
Peter Sprygada e45b71d6cd added new module object to vca 2015-09-18 13:45:37 -04:00
Brian Coca aca83b15e5 Merge pull request #12425 from privateip/devel
initial add of vca common module
2015-09-18 11:24:54 -04:00
Brian Coca 11707576a3 fix for AIX network facts
fixes #12434
2015-09-18 10:43:53 -04:00
Brian Coca d7b61db6dc made boto3 non mandatory 2015-09-18 08:05:33 -04:00
Peter Sprygada 8f43d222c0 initial add of vca common module 2015-09-17 14:41:53 -04:00
Chris Church 5c65ee7f0c Add PowerShell exception handling and turn on strict mode.
* Add exception handling when running PowerShell modules to provide exception message and stack trace.
* Enable strict mode for all PowerShell modules and internal commands.
* Update common PowerShell code to fix strict mode errors.
* Fix an issue with Set-Attr where it would not replace an existing property if already set.
* Add tests for exception handling using modified win_ping modules.
2015-09-15 16:32:35 -04:00
Monty Taylor 3bdd6793ca Add no-log parameter to common openstack args
These bad boys can contain secret data, so should be marked no-log.
2015-09-13 19:48:37 +02:00
Benno Joy 6de13c3062 Merge pull request #11818 from Java1Guy/module_utils_ec2_for_ecs
change ec2 util to create only requested objects
2015-09-10 11:06:19 +05:30
Toshaan Bharvani 4702d2be09 added Manjaro as an Archlinux family 2015-09-05 12:49:20 +02:00
Tim Rupp 6f41a72158 Adds utf-8 encoding to f5 module_utils
The contributor's name on line 10 (originally line 7) includes a character
that the default Python encoding (ASCII) raises an error on when interpreting
the file.

Specifying the utf-8 encoding, as is done in other modules, resolves
the error.

The error being raised is

SyntaxError: Non-ASCII character '\xc3' in file /.../lib/ansible/module_utils/f5.py
on line 7, but no encoding declared; see http://www.python.org/peps/pep-0263.html
for details
2015-09-01 08:10:23 -07:00
Desmond O. Chang 58c3539196 Add host key for ssh url only.
Rewrite function `get_fqdn`.  It returns fqdn for all kinds of urls now.

`add_git_host_key` determines whether a url is ssh and whether its host
key should be added.
2015-08-31 13:42:32 -07:00
James Cammarata 2043fcd5db Merge pull request #12083 from resmo/for-ansible
cloudstack: implement general api_region support, update docs
2015-08-28 13:14:50 -04:00
maty0609 6f24e6f994 Adding support for Archlinux and Slackware in fallback
In some cases Archlinux and Slackware is not detected by
platform.dist(). This should solve the issue.
2015-08-27 10:22:02 +01:00
Rene Moser 3db4039ad1 cloudstack: implement general api_region support, update docs 2015-08-25 13:54:21 +02:00
James Cammarata db65503778 Revert "Add PowerShell exception handling and turn on strict mode." 2015-08-23 21:09:16 -04:00
Chris Church 4b2cdadc98 Add PowerShell exception handling and turn on strict mode.
* Add exception handling when running PowerShell modules to provide exception message and stack trace.
* Enable strict mode for all PowerShell modules and internal commands.
* Update common PowerShell code to fix strict mode errors.
* Fix an issue with Set-Attr where it would not replace an existing property if already set.
* Add tests for exception handling using modified win_ping modules.
2015-08-22 18:28:07 -04:00
Rene Moser d16429b59c cloudstack: rename returns for consistency 2015-08-19 21:25:19 +02:00
Rene Moser 2913d2b44d cloudstack: add more common returns 2015-08-17 08:21:37 +02:00
Brian Coca c6733cc1a7 Merge pull request #9225 from qvicksilver/aix_unprivileged
AIX unprivileged facts collection
2015-08-12 23:48:44 -04:00
Rene Moser 4f3c863b42 cloudstack: refactor get_result()
* A commen dict of keys has been defined, which we look in results returned from the API.
* self.returns dict can be use in subclass to extend this dict.
* Optionally the key name can be replaced with a new key name, often used to make the return keys identical to the arguments passed.
* Use new style class
2015-08-12 23:14:17 +02:00
Brian Coca 6bceee9a93 now lvs/vg facts are only attempted if binary found 2015-08-12 10:53:13 -04:00
Alexander Gubin 1ea1b9fb13 bugfix: missing path for lvm facts 2015-08-12 16:35:31 +02:00