Adds Python 3.x compatible exception handling

Fixes exception handling syntax for Python 3.x compatibility

Changes generated with:

    2to3 -f except -w -n cloudbaseinit
This commit is contained in:
Alessandro Pilotti
2014-09-07 21:03:01 +03:00
parent 2a9be0e16d
commit b59a89e5e5
13 changed files with 14 additions and 14 deletions

View File

@@ -47,7 +47,7 @@ def get_metadata_service():
try:
if service.load():
return service
except Exception, ex:
except Exception as ex:
LOG.error("Failed to load metadata service '%s'" % class_path)
LOG.exception(ex)
raise Exception("No available service found")