diff options
author | Jesse Buchanan <hello@jessebuchanan.ca> | 2014-12-07 13:35:24 -0500 |
---|---|---|
committer | Jesse Buchanan <hello@jessebuchanan.ca> | 2014-12-07 13:35:24 -0500 |
commit | 2d5d7ff542591a55eba0270346087567c8bbeb7b (patch) | |
tree | f7c567c0259478cb7b0112e1d3fc5b30d08aa9b5 /files/file.py | |
parent | 657291d3df05335b78e04b9bb746053972227133 (diff) | |
download | ansible-modules-core-2d5d7ff542591a55eba0270346087567c8bbeb7b.tar.gz |
Files module: Allow touch on hardlinks
Diffstat (limited to 'files/file.py')
-rw-r--r-- | files/file.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/files/file.py b/files/file.py index 7aa5e45d..d8c5b276 100644 --- a/files/file.py +++ b/files/file.py @@ -332,13 +332,13 @@ def main(): open(path, 'w').close() except OSError, e: module.fail_json(path=path, msg='Error, could not touch target: %s' % str(e)) - elif prev_state in ['file', 'directory']: + elif prev_state in ['file', 'directory', 'hard']: try: os.utime(path, None) except OSError, e: module.fail_json(path=path, msg='Error while touching existing target: %s' % str(e)) else: - module.fail_json(msg='Cannot touch other than files and directories') + module.fail_json(msg='Cannot touch other than files, directories, and hardlinks (%s is %s)' % (path, prev_state)) try: module.set_fs_attributes_if_different(file_args, True) except SystemExit, e: |