diff --git a/scenarios/preset/resolve_containers_in_preset.py b/scenarios/preset/resolve_containers_in_preset.py index 78e292c..086c7ec 100755 --- a/scenarios/preset/resolve_containers_in_preset.py +++ b/scenarios/preset/resolve_containers_in_preset.py @@ -2,7 +2,8 @@ import argparse import json -import requests +import http.client +import ssl parser = argparse.ArgumentParser() parser.add_argument('--endpoint', help='Endpoint of the S3 gateway') @@ -16,10 +17,13 @@ def main(): preset = json.loads(preset_text) + conn = http.client.HTTPSConnection(args.endpoint, context = ssl._create_unverified_context()) containers = [] for bucket in preset.get('buckets'): - resp = requests.head(f'{args.endpoint}/{bucket}', verify=False) - containers.append(resp.headers['X-Container-Id']) + conn.request("HEAD", f'/{bucket}') + response = conn.getresponse() + containers.append(response.getheader('X-Container-Id')) + response.read() preset['containers'] = containers with open(args.preset_file, 'w+') as f: