Convert the whole files/ directory to py3 syntax (#3685)

This commit is contained in:
Michael Scherer 2016-05-18 16:01:53 +02:00 committed by Matt Clay
commit f7b29ba8fd
7 changed files with 36 additions and 18 deletions

View file

@ -291,7 +291,8 @@ def main():
# the execute bit for the current user set, in
# which case the stat() call will raise an OSError
os.stat(os.path.dirname(dest))
except OSError, e:
except OSError:
e = get_exception()
if "permission denied" in str(e).lower():
module.fail_json(msg="Destination directory %s is not accessible" % (os.path.dirname(dest)))
module.fail_json(msg="Destination directory %s does not exist" % (os.path.dirname(dest)))