1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

kubevirt_cdi_upload: fix the upload (#54048)

This commit is contained in:
Mariusz Mazur 2019-03-19 17:06:21 +01:00 committed by ansibot
parent f43d97da8a
commit d7c1bb2fc6

View file

@ -158,9 +158,8 @@ class KubeVirtCDIUpload(KubernetesRawModule):
result = self.perform_action(resource, definition) result = self.perform_action(resource, definition)
headers = {'Authorization': "Bearer {0}".format(result['result']['status']['token'])} headers = {'Authorization': "Bearer {0}".format(result['result']['status']['token'])}
files = {'file': imgfile}
url = "{0}/{1}/upload".format(upload_host, API) 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) self.exit_json(changed=True)