From 9d4f70f0ad3f2453697d54dc3db32110e66ef51e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag=20Wie=C3=ABrs?= Date: Tue, 21 Aug 2012 19:36:48 +0200 Subject: [PATCH] Handle special files just like normal files As discussed in #923 --- library/file | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/library/file b/library/file index 5c9fb1e39a..5015c5d585 100755 --- a/library/file +++ b/library/file @@ -39,10 +39,10 @@ def add_path_info(kwargs): # secontext not yet supported if os.path.islink(path): kwargs['state'] = 'link' - elif os.path.isfile(path): - kwargs['state'] = 'file' - else: + elif os.path.isdir(path): kwargs['state'] = 'directory' + else: + kwargs['state'] = 'file' if HAVE_SELINUX and selinux_enabled(): kwargs['secontext'] = ':'.join(selinux_context(path)) else: @@ -270,10 +270,10 @@ def main(): if os.path.lexists(path): if os.path.islink(path): prev_state = 'link' - elif os.path.isfile(path): - prev_state = 'file' - else: + elif os.path.isdir(path): prev_state = 'directory' + else: + prev_state = 'file' if prev_state != 'absent' and state == 'absent': try: