From 40c55034eabe47278b0dbe64cc51d3a662151163 Mon Sep 17 00:00:00 2001 From: Mateusz Date: Sun, 22 Jan 2023 16:51:01 +0100 Subject: [PATCH] update --- Public_cloud/loadbalancer-init.py | 4 ++-- Public_cloud/reset.py | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Public_cloud/loadbalancer-init.py b/Public_cloud/loadbalancer-init.py index 794390d..60620d6 100644 --- a/Public_cloud/loadbalancer-init.py +++ b/Public_cloud/loadbalancer-init.py @@ -54,7 +54,7 @@ for i in range(NUM_OF_SERVERS): webservice_server = client.servers.create( name=f"{PREFIX}-webservice-{i+1}", server_type=ServerType("cx11"), - image=Image(name="ubuntu-20.04"), + image=Image(name="ubuntu-22.04"), ssh_keys=[ssh_key], networks=[vnet], location=Location("hel1"), @@ -83,7 +83,7 @@ try: timeout=10, retries=3, http=LoadBalancerHealtCheckHttp( - path="/factors/10", + path="/factors/32", status_codes=["2??", "3??"], tls=False ) diff --git a/Public_cloud/reset.py b/Public_cloud/reset.py index 370f799..f7be8ed 100644 --- a/Public_cloud/reset.py +++ b/Public_cloud/reset.py @@ -20,4 +20,7 @@ if volume: action = client.volumes.detach(volume) action.wait_until_finished() action = client.volumes.delete(volume) - print("Volume removed") \ No newline at end of file + print("Volume removed") + +loadbalancer = client.load_balancers.get_by_name(f"{PREFIX}-loadbalancer") +loadbalancer.delete() \ No newline at end of file