application: post bundle (#89032)
gitea/hobo/pipeline/head This commit looks good Details

This commit is contained in:
Lauréline Guérin 2024-04-04 14:24:09 +02:00
parent cfdd2e8b9c
commit 25be449635
No known key found for this signature in database
GPG Key ID: 1FAB9B9B4F93D473
2 changed files with 3 additions and 3 deletions

View File

@ -419,7 +419,7 @@ class Version(models.Model):
if service_objects[service['url']].secondary:
continue
url = urllib.parse.urljoin(service['url'], target_url)
response = requests.put(url, data=bundle_content)
response = requests.post(url, files=[('bundle', bundle_content)])
if not response.ok:
raise DeploymentError(exception_message % (service_id, response.status_code))
if not job:
@ -458,7 +458,7 @@ class Version(models.Model):
if service_objects[service['url']].secondary:
continue
url = urllib.parse.urljoin(service['url'], target_url)
response = requests.put(url, data=bundle_content)
response = requests.post(url, files=[('bundle', bundle_content)])
if not response.ok:
raise DeploymentError(exception_message % (service_id, response.status_code))
if not job:

View File

@ -218,7 +218,7 @@ def mocked_http(url, request):
if url.path == '/api/export-import/bundle-import/':
# alter WCS_AVAILABLE_FORMS response with newly installed forms
with tarfile.open(mode='r', fileobj=io.BytesIO(request.body)) as tar:
with tarfile.open(mode='r', fileobj=io.BytesIO(request.original.files[0][1])) as tar:
manifest_json = json.load(tar.extractfile('manifest.json'))
for element in manifest_json.get('elements'):
if element['type'] not in [x['id'] for x in WCS_AVAILABLE_OBJECTS['data']]: