Is it possible to use squeezer api_call to upload deb packages?
I got successful result using file_url
- name: Test upload deb pulp.squeezer.api_call: pulp_url: "{{ pulp_url }}" username: "{{ pulp_username }}" password: "{{ pulp_password }}" operation_id: content_deb_packages_create body: repository: "/pulp/api/v3/repositories/deb/apt/0194fee6-d12a-749d-b0a4-68139a90009f/" distribution: "pulp" file_url: "http://url.ru/drbd-dkms_9.0.28-1_all.deb" component: "upload"
But using “file”
- name: Test upload deb pulp.squeezer.api_call: pulp_url: "{{ pulp_url }}" username: "{{ pulp_username }}" password: "{{ pulp_password }}" operation_id: content_deb_packages_create body: repository: "/pulp/api/v3/repositories/deb/apt/0194fee6-d12a-749d-b0a4-68139a90009f/" distribution: "pulp" file: "drbd-dkms_9.0.28-1_all.deb" component: "upload"
I get an error.
Traceback (most recent call last):
File “/var/folders/_y/lxx279711lq6h92nd3dyshwc0000gn/T/ansible_pulp.squeezer.api_call_payload_brg420a4/ansible_pulp.squeezer.api_call_payload.zip/ansible_collections/pulp/squeezer/plugins/modules/api_call.py”, line 93, in main
File “/Users/samokat/.pyenv/versions/3.9.16/lib/python3.9/site-packages/pulp_glue/common/context.py”, line 450, in call
result = self.api.call(File “/Users/samokat/.pyenv/versions/3.9.16/lib/python3.9/site-packages/pulp_glue/common/openapi.py”, line 633, in call
response = self._send_request(File “/Users/samokat/.pyenv/versions/3.9.16/lib/python3.9/site-packages/pulp_glue/common/openapi.py”, line 477, in _send_request
content_type, data, files = self._render_request_body(method_spec, body, validate_body)File “/Users/samokat/.pyenv/versions/3.9.16/lib/python3.9/site-packages/pulp_glue/common/openapi.py”, line 421, in _render_request_body
self.validate_schema(File “/Users/samokat/.pyenv/versions/3.9.16/lib/python3.9/site-packages/pulp_glue/common/openapi.py”, line 369, in validate_schema
validate(schema, name, value, self.api_spec[“components”][“schemas”])File “/Users/samokat/.pyenv/versions/3.9.16/lib/python3.9/site-packages/pulp_glue/common/schema.py”, line 98, in validate
_validate_ref(schema_ref, name, value, components)File “/Users/samokat/.pyenv/versions/3.9.16/lib/python3.9/site-packages/pulp_glue/common/schema.py”, line 140, in _validate_ref
validate(components[schema_name], name, value, components)File “/Users/samokat/.pyenv/versions/3.9.16/lib/python3.9/site-packages/pulp_glue/common/schema.py”, line 107, in validate
value = typed_transform(schema, name, value, components)File “/Users/samokat/.pyenv/versions/3.9.16/lib/python3.9/site-packages/pulp_glue/common/schema.py”, line 203, in _validate_object
validate(pschema, f"{name}[{pname}]", pvalue, components)File “/Users/samokat/.pyenv/versions/3.9.16/lib/python3.9/site-packages/pulp_glue/common/schema.py”, line 107, in validate
value = typed_transform(schema, name, value, components)File “/Users/samokat/.pyenv/versions/3.9.16/lib/python3.9/site-packages/pulp_glue/common/schema.py”, line 235, in _validate_string
_assert_type(name, value, (bytes, io.BufferedReader, io.BytesIO), “binary”)File “/Users/samokat/.pyenv/versions/3.9.16/lib/python3.9/site-packages/pulp_glue/common/schema.py”, line 56, in _assert_type
raise ValidationError(pulp_glue.common.schema.ValidationError: ‘body[file]’ is expected to be a binary.
How to correctly specify the path to the file?