summaryrefslogtreecommitdiff
path: root/lib/ansible/module_utils/ec2.py
diff options
context:
space:
mode:
authorToshio Kuratomi <a.badger@gmail.com>2016-04-05 11:06:17 -0700
committerToshio Kuratomi <a.badger@gmail.com>2016-04-05 11:06:17 -0700
commit4b0aa1214ca989c71bb87f7a805b1e3673faefa9 (patch)
tree62f7f893cd26e41f002e1c84941da8be96e0510b /lib/ansible/module_utils/ec2.py
parent6a3670b1f07e16ec71b00f20ab2a9e60eecb5e34 (diff)
downloadansible-4b0aa1214ca989c71bb87f7a805b1e3673faefa9.tar.gz
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
Diffstat (limited to 'lib/ansible/module_utils/ec2.py')
-rw-r--r--lib/ansible/module_utils/ec2.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/ansible/module_utils/ec2.py b/lib/ansible/module_utils/ec2.py
index b0c4a323ad..d966429a8c 100644
--- a/lib/ansible/module_utils/ec2.py
+++ b/lib/ansible/module_utils/ec2.py
@@ -25,10 +25,17 @@
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
# USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
import os
from time import sleep
try:
+ import boto
+ HAS_BOTO = True
+except ImportError:
+ HAS_BOTO = False
+
+try:
import boto3
import botocore
HAS_BOTO3 = True