fix
This commit is contained in:
parent
f4dfcea203
commit
f43b90c2a5
@ -14,13 +14,12 @@ minio_client = Minio(
|
|||||||
|
|
||||||
def get(url):
|
def get(url):
|
||||||
with urlopen('https://example.com') as response:
|
with urlopen('https://example.com') as response:
|
||||||
data = response.read()
|
data = response.read().decode('utf-8')
|
||||||
return loads(data)
|
return loads(data)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
response = get('http://configurator/api/v1/fetch?project=certupdater&stage=development')
|
response = get('http://configurator/api/v1/fetch?project=certupdater&stage=development')
|
||||||
response.raise_for_status() # Raises an exception for HTTP errors
|
hosts = response['configs']['hosts']
|
||||||
hosts = response.json()['configs']['hosts']
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"Error fetching config: {e}", file=sys.stderr)
|
print(f"Error fetching config: {e}", file=sys.stderr)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
Loading…
Reference in New Issue
Block a user