From c24956032d0e5934554c57b60a7ecd4593915dc8 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Tue, 18 Mar 2014 22:39:45 -0400 Subject: [PATCH] unified calls to fs function vs duplicate functions for file and directory --- library/files/assemble | 2 +- library/files/copy | 4 ++-- library/files/ini_file | 2 +- library/files/lineinfile | 2 +- library/network/get_url | 2 +- library/network/uri | 2 +- library/web_infrastructure/htpasswd | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/library/files/assemble b/library/files/assemble index 7f0a9d1e0a..cfb0ded6e5 100644 --- a/library/files/assemble +++ b/library/files/assemble @@ -192,7 +192,7 @@ def main(): os.remove(path) file_args = module.load_file_common_arguments(module.params) - changed = module.set_file_attributes_if_different(file_args, changed) + changed = module.set_fs_attributes_if_different(file_args, changed) # Mission complete module.exit_json(src=src, dest=dest, md5sum=pathmd5, changed=changed, msg="OK") diff --git a/library/files/copy b/library/files/copy index 47012155f2..a62a6d22c8 100644 --- a/library/files/copy +++ b/library/files/copy @@ -123,7 +123,7 @@ def adjust_recursive_directory_permissions(pre_existing_dir, new_directory_list, if len(new_directory_list) > 0: working_dir = os.path.join(pre_existing_dir, new_directory_list.pop(0)) directory_args['path'] = working_dir - changed = module.set_directory_attributes_if_different(directory_args, changed) + changed = module.set_fs_attributes_if_different(directory_args, changed) changed = adjust_recursive_directory_permissions(working_dir, new_directory_list, module, directory_args, changed) return changed @@ -224,7 +224,7 @@ def main(): module.params['dest'] = dest file_args = module.load_file_common_arguments(module.params) - res_args['changed'] = module.set_file_attributes_if_different(file_args, res_args['changed']) + res_args['changed'] = module.set_fs_attributes_if_different(file_args, res_args['changed']) module.exit_json(**res_args) diff --git a/library/files/ini_file b/library/files/ini_file index d25d468cd1..dbb015d79d 100644 --- a/library/files/ini_file +++ b/library/files/ini_file @@ -179,7 +179,7 @@ def main(): changed = do_ini(module, dest, section, option, value, state, backup) file_args = module.load_file_common_arguments(module.params) - changed = module.set_file_attributes_if_different(file_args, changed) + changed = module.set_fs_attributes_if_different(file_args, changed) # Mission complete module.exit_json(dest=dest, changed=changed, msg="OK") diff --git a/library/files/lineinfile b/library/files/lineinfile index ef629382f2..be6209e2b7 100644 --- a/library/files/lineinfile +++ b/library/files/lineinfile @@ -167,7 +167,7 @@ def write_changes(module,lines,dest): def check_file_attrs(module, changed, message): file_args = module.load_file_common_arguments(module.params) - if module.set_file_attributes_if_different(file_args, False): + if module.set_fs_attributes_if_different(file_args, False): if changed: message += " and " diff --git a/library/network/get_url b/library/network/get_url index 132c8553eb..e2384e4ebd 100644 --- a/library/network/get_url +++ b/library/network/get_url @@ -293,7 +293,7 @@ def main(): module.params['path'] = dest file_args = module.load_file_common_arguments(module.params) file_args['path'] = dest - changed = module.set_file_attributes_if_different(file_args, changed) + changed = module.set_fs_attributes_if_different(file_args, changed) # Mission complete module.exit_json(url=url, dest=dest, src=tmpsrc, md5sum=md5sum_src, diff --git a/library/network/uri b/library/network/uri index 55fd34d0d0..8d62463df7 100644 --- a/library/network/uri +++ b/library/network/uri @@ -414,7 +414,7 @@ def main(): module.params['path'] = dest file_args = module.load_file_common_arguments(module.params) file_args['path'] = dest - changed = module.set_file_attributes_if_different(file_args, changed) + changed = module.set_fs_attributes_if_different(file_args, changed) resp['path'] = dest else: changed = False diff --git a/library/web_infrastructure/htpasswd b/library/web_infrastructure/htpasswd index d77858d10e..4a72ea37fe 100644 --- a/library/web_infrastructure/htpasswd +++ b/library/web_infrastructure/htpasswd @@ -163,7 +163,7 @@ def absent(dest, username, check_mode): def check_file_attrs(module, changed, message): file_args = module.load_file_common_arguments(module.params) - if module.set_file_attributes_if_different(file_args, False): + if module.set_fs_attributes_if_different(file_args, False): if changed: message += " and "