From 1e4765d0462c279a1a1689c426d38a388d58dd44 Mon Sep 17 00:00:00 2001 From: Abhijeet Kasurde Date: Tue, 6 Aug 2019 18:37:06 +0000 Subject: [PATCH] gcp_storage_object: Check remote_object before operation Signed-off-by: Modular Magician --- lib/ansible/modules/cloud/google/gcp_storage_object.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/cloud/google/gcp_storage_object.py b/lib/ansible/modules/cloud/google/gcp_storage_object.py index fc3c304733eebe..f57a08d9acb749 100644 --- a/lib/ansible/modules/cloud/google/gcp_storage_object.py +++ b/lib/ansible/modules/cloud/google/gcp_storage_object.py @@ -164,7 +164,7 @@ def main(): module.fail_json(msg="File does not exist on disk") # Check if we'll be overwriting files. - if not module.params['overwrite']: + if remote_object and not module.params['overwrite']: remote_object['changed'] = False if module.params['action'] == 'download' and local_file_exists: # If files differ, throw an error