Commit Graph

27 Commits (d3d812b60489f84502ee38f69b7cee586d54e181)

Author SHA1 Message Date
Matt Clay e45c763b64 Fix invalid string escape sequences. 2017-11-21 10:03:34 -08:00
Toshio Kuratomi ff22528b07 Consolidate boolean/mk_boolean conversion functions into a single location
Consolidate the module_utils, constants, and config functions that
convert values into booleans into a single function in module_utils.

Port code to use the module_utils.validate.convert_bool.boolean function
isntead of mk_boolean.
2017-07-17 11:48:05 -07:00
Dag Wieers d07f18fbb9 module_utils/rax: Small parameter cleanup (#24664)
Nothing really fancy.

- Removing boolean choices
- Use path-type for credentials
2017-05-16 10:02:04 -04:00
Toshio Kuratomi a22909c226 Migrate basestring to a python3 compatible type (#17199) 2016-08-23 13:13:44 -07:00
Michael Scherer fb2355e47d Port rax.py to python3 compatible syntax (#15875)
Since the pyrax website say that only python 2.7 is tested,
I do not think it is worth to aim for python 2.4 compatibility
for the various rackspace modules.
2016-05-16 17:30:25 -07:00
Toshio Kuratomi 186337db28 Ship constants to the modules via internal module params rather than a secondary dict. 2016-05-12 20:30:05 -07:00
Toshio Kuratomi 487e6562ca Fix ziploader for the cornercase of ansible invoking ansible.
* Make ziploader's ansible and ansible.module_utils libraries into
  namespace packages.
* Move __version__ and __author__ from ansible/__init__ to
  ansible/release.py.  This is because namespace packages only load one
  __init__.py.  If that is not the __init__.py with the author and
  version info then those won't be available.
* In ziplaoder, move the version ito ANSIBLE_CONSTANTS.
* Change PluginLoader to properly construct the path to the plugins even
  when namespace packages are present.
2016-04-29 08:47:49 -07:00
Toshio Kuratomi 4b0aa1214c Ziploader
* Ziploader proof of concept (jimi-c)

* Cleanups to proof of concept ziploader branch:

* python3 compatible base64 encoding
* zipfile compression (still need to enable toggling this off for
  systems without zlib support in python)
* Allow non-wildcard imports (still need to make this recusrsive so that
  we can have module_utils code that imports other module_utils code.)
* Better tracebacks: module filename is kept and module_utils directory
  is kept so that tracebacks show the real filenames that the errors
  appear in.

* Make sure we import modules that are used into the module_utils files that they are used in.

* Set ansible version in a more pythonic way for ziploader than we were doing in module replacer

* Make it possible to set the module compression as an inventory var

This may be necessary on systems where python has been compiled without
zlib compression.

* Refactoring of module_common code:

* module replacer only replaces values that make sense for that type of
  file (example: don't attempt to replace python imports if we're in
  a powershell module).
* Implement configurable shebang support for ziploader wrapper
* Implement client-side constants (for SELINUX_SPECIAL_FS and SYSLOG)
  via environment variable.
* Remove strip_comments param as we're never going to use it (ruins line
  numbering)

* Don't repeat ourselves about detecting REPLACER

* Add an easy way to debug

* Port test-module to the ziploader-aware modify_module()

* strip comments and blank lines from the wrapper so we send less over the wire.

* Comments cleanup

* Remember to output write the module line itself in powershell modules

* for line in lines strips the newlines so we have to add them back in
2016-04-05 11:06:17 -07:00
Toshio Kuratomi 3219744d32 One more stdlib import in module_utils 2015-11-02 12:25:18 -08:00
Toshio Kuratomi 1bc75374dc Add imports for stdlib modules that are used.
This is cleanup that will aid us when we get ziploader implemented for 2.1
2015-11-02 12:02:26 -08:00
Matt Martz 4990814901 Prevent an empty error message 2015-03-10 11:30:28 -05:00
Matt Martz cfd05ceafc Add new rax_find_bootable_volume to assist with boot from volume 2015-02-13 15:25:42 -06:00
Matt Martz 047dffdd01 Fix rax_find_loadbalancer issues
* Loadbalancer IDs are not UUIDs
* Ensure found list exists before using it
2014-11-06 16:41:34 -06:00
Matt Martz 55ed4489e3 Perform region validation early to be more explicit about invalid region failures 2014-09-02 09:17:40 -05:00
Matt Martz 7d0eba19ab Dedupe PTR record related code in rax_dns_record 2014-08-06 16:47:33 -05:00
Matt Martz 88acb48753 Add ANSIBLE_VERSION to module_utils/basic.py and manipulate the pyrax user-agent 2014-08-06 16:28:42 -05:00
Matt Martz 585fd5a138 Move additional rackspace common code into module_utils/rax.py 2014-08-06 16:26:48 -05:00
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
2014-03-10 16:06:52 -05:00
Matt Martz ac666e63e0 Support providing a tenant_name also 2014-01-28 13:58:41 -06:00
Matt Martz aa709012ba Make sure to also include the region when using keyring_auth 2014-01-28 13:58:41 -06:00
Matt Martz 021b926235 Only specify to USE_KEYRING as the api_key/password when we actually got a keyring_username from ~/.pyrax.cfg 2014-01-28 13:58:41 -06:00
Matt Martz 1ac7dffd55 Support using ~/.pyrax.cfg and multi environments 2014-01-28 13:58:41 -06:00
Matt Martz 139e905e98 identity_type is set dynamically above 2014-01-28 13:58:41 -06:00
Matt Martz bc473c5be3 Support additional attributes that would allow the rax modules to work with other OpenStack clouds 2014-01-28 13:58:41 -06:00
Matt Martz d7597414b8 Support keyring for the api_key 2014-01-28 13:58:40 -06:00
Matt Martz d46037d64c Do not log the rax api_key argument in module invocation 2014-01-15 16:38:03 -06:00
Matt Martz 3f2cbb7583 Add ansible.module_utils.rax 2013-11-21 15:46:25 -06:00