From f7fafa8c1602ed075f2dc0e8ec169fe2b2dd8210 Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Wed, 19 Nov 2014 13:04:44 -0800 Subject: [PATCH] Cannot readlink() on a hard link --- lib/ansible/modules/files/file.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/files/file.py b/lib/ansible/modules/files/file.py index be7b05aaf52..7aa5e45d7bc 100644 --- a/lib/ansible/modules/files/file.py +++ b/lib/ansible/modules/files/file.py @@ -170,7 +170,7 @@ def main(): src = os.path.expanduser(src) else: if state in ['link','hard']: - if follow: + if follow and state == 'link': # use the current target of the link as the source src = os.readlink(path) else: