aboutsummaryrefslogtreecommitdiff
path: root/ansible/library
diff options
context:
space:
mode:
authorHengqing Hu <hudayou@hotmail.com>2015-08-31 15:58:13 +0800
committerHengqing Hu <hudayou@hotmail.com>2015-09-01 14:15:27 +0800
commit1dab839de49be7ef92f274416b417b2007c1d9bd (patch)
treedb2e0fb67eeae256dc41993b9ba79d09da46f81d /ansible/library
parent3f5b6013038890f6ec13af37dc1e7b6301149968 (diff)
downloadkolla-1dab839de49be7ef92f274416b417b2007c1d9bd.tar.gz
kolla-1dab839de49be7ef92f274416b417b2007c1d9bd.zip
Expose exception objects via the as keyword
According to Python 3 Porting guide http://docs.pythonsprints.com/python3_porting/py-porting.html Exceptions were changed in a few ways for Python 3. First, strings are no longer usable as exceptions. Additionally, the raise syntax no longer accepts comma-separated arguments, instead working with exception instances. Perhaps the largest difference in Python 3 is that exception objects are only available via the as keyword, which was introduced in 2.6. Change-Id: Ide665ecc4b7f14bd58bafab47e05a86a4cf2d141 Closes-Bug: #1490526
Diffstat (limited to 'ansible/library')
-rw-r--r--ansible/library/merge_configs.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/ansible/library/merge_configs.py b/ansible/library/merge_configs.py
index 155291d0e..e894322ed 100644
--- a/ansible/library/merge_configs.py
+++ b/ansible/library/merge_configs.py
@@ -87,7 +87,7 @@ def main():
config.write(f)
module.exit_json(changed=changed)
- except Exception, e:
+ except Exception as e:
module.exit_json(failed=True, changed=changed, msg=repr(e))