summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToshio Kuratomi <toshio@fedoraproject.org>2016-06-13 12:00:31 -0700
committerToshio Kuratomi <toshio@fedoraproject.org>2016-06-13 12:00:31 -0700
commit1d0f4088973afd6440c58d7f2d14a0e3663b5146 (patch)
tree13dd155ab4aa6100b2ee135c370c46a4e576e7d8
parent1e0bb94ced42104e688b8580797c0adb6dd08228 (diff)
downloadansible-modules-core-1d0f4088973afd6440c58d7f2d14a0e3663b5146.tar.gz
Finish python3 syntax compilation fixing for core repo
-rw-r--r--.travis.yml11
-rw-r--r--cloud/amazon/cloudformation.py10
2 files changed, 7 insertions, 14 deletions
diff --git a/.travis.yml b/.travis.yml
index 422b76b5..ea3133a6 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -10,13 +10,6 @@ addons:
- python2.4
- python2.6
- python3.5
-env:
- global:
- # 76 modules. Let's whittle this down!
- - PY3_EXCLUDE_LIST="cloud/amazon/cloudformation.py
- utilities/helper/accelerate.py
- utilities/logic/async_status.py
- utilities/logic/async_wrapper.py"
before_install:
- git config user.name "ansible"
- git config user.email "ansible@ansible.com"
@@ -29,8 +22,8 @@ script:
- python2.4 -m compileall -fq cloud/amazon/_ec2_ami_search.py cloud/amazon/ec2_facts.py
- python2.6 -m compileall -fq .
- python2.7 -m compileall -fq .
- - python3.4 -m compileall -fq . -x $(echo "$PY3_EXCLUDE_LIST"| tr ' ' '|')
- - python3.5 -m compileall -fq . -x $(echo "$PY3_EXCLUDE_LIST"| tr ' ' '|')
+ - python3.4 -m compileall -fq .
+ - python3.5 -m compileall -fq .
- ansible-validate-modules --exclude 'utilities/' .
#- ansible-validate-modules --exclude 'cloud/amazon/ec2_lc\.py|cloud/amazon/ec2_scaling_policy\.py|cloud/amazon/ec2_scaling_policy\.py|cloud/amazon/ec2_asg\.py|cloud/azure/azure\.py|packaging/os/rhn_register\.py|network/openswitch/ops_template\.py|system/hostname\.py|utilities/' .
#- ./test-docs.sh core
diff --git a/cloud/amazon/cloudformation.py b/cloud/amazon/cloudformation.py
index 8a142fd1..59cd7215 100644
--- a/cloud/amazon/cloudformation.py
+++ b/cloud/amazon/cloudformation.py
@@ -229,7 +229,7 @@ def invoke_with_throttling_retries(function_ref, *argv):
try:
retval=function_ref(*argv)
return retval
- except boto.exception.BotoServerError, e:
+ except boto.exception.BotoServerError as e:
if e.code != IGNORE_CODE or retries==MAX_RETRIES:
raise e
time.sleep(5 * (2**retries))
@@ -303,7 +303,7 @@ def main():
try:
cfn = connect_to_aws(boto.cloudformation, region, **aws_connect_kwargs)
- except boto.exception.NoAuthHandlerFound, e:
+ except boto.exception.NoAuthHandlerFound as e:
module.fail_json(msg=str(e))
update = False
result = {}
@@ -322,7 +322,7 @@ def main():
capabilities=['CAPABILITY_IAM'],
**kwargs)
operation = 'CREATE'
- except Exception, err:
+ except Exception as err:
error_msg = boto_exception(err)
if 'AlreadyExistsException' in error_msg or 'already exists' in error_msg:
update = True
@@ -344,7 +344,7 @@ def main():
template_url=template_url,
capabilities=['CAPABILITY_IAM'])
operation = 'UPDATE'
- except Exception, err:
+ except Exception as err:
error_msg = boto_exception(err)
if 'No updates are to be performed.' in error_msg:
result = dict(changed=False, output='Stack is already up-to-date.')
@@ -381,7 +381,7 @@ def main():
try:
invoke_with_throttling_retries(cfn.describe_stacks,stack_name)
operation = 'DELETE'
- except Exception, err:
+ except Exception as err:
error_msg = boto_exception(err)
if 'Stack:%s does not exist' % stack_name in error_msg:
result = dict(changed=False, output='Stack not found.')