Fixing compile time error exception handling for python 3. (#3843)
This commit is contained in:
parent
e2dbd0f445
commit
c3aab8ddcf
3 changed files with 5 additions and 5 deletions
|
@ -317,7 +317,7 @@ def core(module):
|
|||
|
||||
try:
|
||||
api_token = module.params['api_token'] or os.environ['DO_API_TOKEN'] or os.environ['DO_API_KEY']
|
||||
except KeyError, e:
|
||||
except KeyError as e:
|
||||
module.fail_json(msg='Unable to load %s' % e.message)
|
||||
|
||||
changed = True
|
||||
|
@ -433,9 +433,9 @@ def main():
|
|||
|
||||
try:
|
||||
core(module)
|
||||
except TimeoutError, e:
|
||||
except TimeoutError as e:
|
||||
module.fail_json(msg=str(e), id=e.id)
|
||||
except (DoError, Exception), e:
|
||||
except (DoError, Exception) as e:
|
||||
module.fail_json(msg=str(e))
|
||||
|
||||
# import module snippets
|
||||
|
|
|
@ -174,7 +174,7 @@ def core(module):
|
|||
|
||||
try:
|
||||
api_token = module.params['api_token'] or os.environ['DO_API_TOKEN'] or os.environ['DO_API_KEY']
|
||||
except KeyError, e:
|
||||
except KeyError as e:
|
||||
module.fail_json(msg='Unable to load %s' % e.message)
|
||||
|
||||
changed = True
|
||||
|
|
|
@ -132,7 +132,7 @@ def core(module):
|
|||
# params['client_id'] will be None even if client_id is not passed in
|
||||
client_id = module.params['client_id'] or os.environ['DO_CLIENT_ID']
|
||||
api_key = module.params['api_key'] or os.environ['DO_API_KEY']
|
||||
except KeyError, e:
|
||||
except KeyError as e:
|
||||
module.fail_json(msg='Unable to load %s' % e.message)
|
||||
|
||||
changed = True
|
||||
|
|
Loading…
Reference in a new issue