diff --git a/lib/ansible/modules/cloud/kubevirt/kubevirt_cdi_upload.py b/lib/ansible/modules/cloud/kubevirt/kubevirt_cdi_upload.py index 79edb927768..526de90a359 100644 --- a/lib/ansible/modules/cloud/kubevirt/kubevirt_cdi_upload.py +++ b/lib/ansible/modules/cloud/kubevirt/kubevirt_cdi_upload.py @@ -158,9 +158,8 @@ class KubeVirtCDIUpload(KubernetesRawModule): result = self.perform_action(resource, definition) headers = {'Authorization': "Bearer {0}".format(result['result']['status']['token'])} - files = {'file': imgfile} url = "{0}/{1}/upload".format(upload_host, API) - requests.post(url, files=files, headers=headers, verify=upload_host_verify_ssl) + requests.post(url, data=imgfile, headers=headers, verify=upload_host_verify_ssl) self.exit_json(changed=True)