mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-29 12:29:10 -07:00
Change exceptions to python3 syntax.
This commit is contained in:
parent
62c08d96e5
commit
6747f82547
22 changed files with 38 additions and 38 deletions
|
@ -70,7 +70,7 @@ class ActionModule(ActionBase):
|
|||
else:
|
||||
content_tempfile = self._create_content_tempfile(content)
|
||||
source = content_tempfile
|
||||
except Exception, err:
|
||||
except Exception as err:
|
||||
return dict(failed=True, msg="could not write content temp file: %s" % err)
|
||||
|
||||
###############################################################################################
|
||||
|
@ -270,7 +270,7 @@ class ActionModule(ActionBase):
|
|||
if module_return.get('changed') == True:
|
||||
changed = True
|
||||
|
||||
# the file module returns the file path as 'path', but
|
||||
# the file module returns the file path as 'path', but
|
||||
# the copy module uses 'dest', so add it if it's not there
|
||||
if 'path' in module_return and 'dest' not in module_return:
|
||||
module_return['dest'] = module_return['path']
|
||||
|
@ -297,7 +297,7 @@ class ActionModule(ActionBase):
|
|||
content = to_bytes(content)
|
||||
try:
|
||||
f.write(content)
|
||||
except Exception, err:
|
||||
except Exception as err:
|
||||
os.remove(content_tempfile)
|
||||
raise Exception(err)
|
||||
finally:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue