This commit is contained in:
s444501 2023-01-12 17:42:56 +01:00
parent c56b6ac4e9
commit 737cb42116
2 changed files with 4 additions and 4 deletions

View File

@ -45,7 +45,7 @@ print('\tdone.') if VERBOSE else None
print("Clearing load balancer... ", end='') if VERBOSE else None
try:
action = client.servers.delete(client.load_balancers.get_by_name(load_balancer_name))
action = client.load_balancers.delete(client.load_balancers.get_by_name(load_balancer_name))
action.wait_until_finished()
except AttributeError:
pass

View File

@ -51,8 +51,8 @@ for i in range(SERVER_COUNT):
user_data=cloud_init
)
server.action.wait_until_finished()
print(f"Tworzenie serwera: {server.action.complete}")
lb_targets.append(LoadBalancerTarget(type="server", server=server, use_private_ip=True))
print(f"Tworzenie serwera {i+1}: {server.action.complete}")
lb_targets.append(LoadBalancerTarget(type="server", server=server.server, use_private_ip=True))
lb = client.load_balancers.create(
@ -76,4 +76,4 @@ lb.action.wait_until_finished()
print(f"Mechanizm równoważenia obciążenia został utworzony: {lb.action.complete}")
print(f"Webserwis pod adresem http://{lb.data_model.public_net.ipv4.ip}:8080/factors/")
print(f"Webserwis pod adresem http://{lb.load_balancer.data_model.public_net.ipv4.ip}:8080/factors/")