From 86ef514887f3351a4c5f74f158afc171c5a4a2d4 Mon Sep 17 00:00:00 2001 From: cclauss Date: Mon, 23 Jul 2018 12:55:53 +0200 Subject: [PATCH] Old style exceptions --> new style for Python 3 Python 3 treats old style exceptions as syntax errors. Discovered via https://travis-ci.com/nodejs/node/builds/79706150 (https://github.com/nodejs/node/pull/21942) --- ansible/plugins/inventory/nodejs_yaml.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/plugins/inventory/nodejs_yaml.py b/ansible/plugins/inventory/nodejs_yaml.py index eb5aff917..c987fe631 100755 --- a/ansible/plugins/inventory/nodejs_yaml.py +++ b/ansible/plugins/inventory/nodejs_yaml.py @@ -113,7 +113,7 @@ def main(): parsed_host = parse_host(hostname) for k, v in parsed_host.iteritems(): c.update({k: v[0] if type(v) is dict else v}) - except Exception, e: + except Exception as e: raise Exception('Failed to parse host: %s' % e) c.update({'ansible_host': metadata['ip']})