From 0c275424c6b29236a8ea4faeb1afd923c8a59813 Mon Sep 17 00:00:00 2001 From: bennojoy Date: Tue, 22 Oct 2013 09:03:52 +0530 Subject: [PATCH] fix to work like copy module --- library/cloud/gc_storage | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/cloud/gc_storage b/library/cloud/gc_storage index a74475b5e5..6cad93eb5b 100644 --- a/library/cloud/gc_storage +++ b/library/cloud/gc_storage @@ -263,7 +263,7 @@ def get_download_url(module, gs, bucket, obj, expiry): def handle_get(module, gs, bucket, obj, overwrite, dest): md5_remote = keysum(module, gs, bucket, obj) md5_local = hashlib.md5(open(dest, 'rb').read()).hexdigest() - if md5_local == md5_remote and not overwrite: + if md5_local == md5_remote: module.exit_json(changed=False) if md5_local != md5_remote and not overwrite: module.exit_json(msg="WARNING: Checksums do not match. Use overwrite parameter to force download.", failed=True) @@ -279,8 +279,8 @@ def handle_put(module, gs, bucket, obj, overwrite, src, expiration): if bucket_rc and key_rc: md5_remote = keysum(module, gs, bucket, obj) md5_local = hashlib.md5(open(src, 'rb').read()).hexdigest() - if md5_local == md5_remote and not overwrite: - module.exit_json(msg="Local and remote object are identical. Use overwrite to force upload", changed=False) + if md5_local == md5_remote: + module.exit_json(msg="Local and remote object are identical", changed=False) if md5_local != md5_remote and not overwrite: module.exit_json(msg="WARNING: Checksums do not match. Use overwrite parameter to force upload.", failed=True) else: