diff --git a/netbox_proxbox/backend/routes/proxbox/clusters/__init__.py b/netbox_proxbox/backend/routes/proxbox/clusters/__init__.py index b0acbd8..1390d86 100755 --- a/netbox_proxbox/backend/routes/proxbox/clusters/__init__.py +++ b/netbox_proxbox/backend/routes/proxbox/clusters/__init__.py @@ -272,7 +272,7 @@ async def get_nodes( await log(websocket, f" Searching children interface of bridge interface {create_interface.name}.") print(f"current_node.id: {current_node.id} / current_node: {current_node} / current_node.name: {current_node.name}") - log(websocket, f"Searching child interface {port} with Device ID {current_node.id}") + await log(websocket, f" Child interface {port} with Device ID {current_node.id}") netbox_port = await Interface(nb=nb, websocket=websocket, primary_field_value=current_node.id).get( name=port ) @@ -310,7 +310,7 @@ async def get_nodes( if create_interface: if create_interface.device == current_node.id: - await log(websocket, f"Creating interface {port}...") + await log(websocket, f" Creating interface {port}...") try: new_netbox_port = await Interface(nb=nb, websocket=websocket, primary_field_value=current_node.id).post(data={ @@ -339,7 +339,7 @@ async def get_nodes( print(f"[2] cidr: {cidr}") if cidr: - await log(websocket, f" If interface with network configured, create IP Address {cidr} and attach interface to it.") + await log(websocket, f" If interface with network configured, create IP Address {cidr} and attach interface to it.") try: create_ipaddress = await IPAddress(nb=nb, websocket=websocket, primary_field_value=cidr).post(data={ "address": cidr, @@ -371,7 +371,7 @@ async def get_nodes( print("\n") - await log(websocket, f" Nodes: {nodes}", "debug") + await log(websocket, f" Nodes: {nodes}", "debug") result.append({ @@ -680,7 +680,7 @@ class VirtualMachineStatus(Enum): } try: - await log(websocket, f" Creating Virtual Machine {vm.get("name")} on Netbox...") + await log(websocket, f" Creating Virtual Machine {vm.get("name")} on Netbox...") new_virtual_machine = await VirtualMachine(nb = nb, websocket = websocket).post(data = virtual_machine_data) if new_virtual_machine: @@ -692,7 +692,7 @@ class VirtualMachineStatus(Enum): if "Virtual machine name must be unique per cluster." in str(error): print("\nDUPLICATED VIRTUAL MACHINE NAME\n") - log(websocket, f" Duplicated virtual machine NAME {virtual_machine_data["name"]} found within the same cluster. Appending '(2)' to the name") + log(websocket, f" Duplicated virtual machine NAME {virtual_machine_data["name"]} found within the same cluster. Appending '(2)' to the name") virtual_machine_data["name"] = f"{virtual_machine_data["name"]} (2)" duplicated_virtual_machine = await VirtualMachine(nb = nb, websocket = websocket).post(data = virtual_machine_data) @@ -715,7 +715,7 @@ class VirtualMachineStatus(Enum): vm_networks = [] network_id = 0 - await log(websocket, " Getting network info and parsing data into JSON (dict)") + await log(websocket, " Getting network info and parsing data into JSON (dict)") while True: network_name = f"net{network_id}" @@ -758,7 +758,7 @@ class VirtualMachineStatus(Enum): hwaddr = v.get("hwaddr", None) if hwaddr: mac_address=hwaddr - await log(websocket, f" Try creating VirtualMachine Interface {str(k)} on Netbox...") + await log(websocket, f" Try creating VirtualMachine Interface {str(k)} on Netbox...") try: