From 10666b14173ad817e9e3ee11f54224907d519328 Mon Sep 17 00:00:00 2001 From: Emerson Felipe Date: Tue, 26 Nov 2024 12:00:30 +0000 Subject: [PATCH] Fix single-quote typo --- netbox_proxbox/backend/routes/netbox/generic.py | 10 +++++----- .../backend/routes/netbox/virtualization/cluster.py | 2 +- .../routes/netbox/virtualization/virtual_machines.py | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/netbox_proxbox/backend/routes/netbox/generic.py b/netbox_proxbox/backend/routes/netbox/generic.py index 625da99..0105e1b 100755 --- a/netbox_proxbox/backend/routes/netbox/generic.py +++ b/netbox_proxbox/backend/routes/netbox/generic.py @@ -425,7 +425,7 @@ async def post( if response: await log( self.websocket, - f" {self.object_name} object created successfully. {self.object_name} ID: {getattr(response, "id", "Not specified.")}" + f" {self.object_name} object created successfully. {self.object_name} ID: {getattr(response, 'id', 'Not specified.')}" ) return response @@ -674,9 +674,9 @@ async def _check_duplicate(self, search_params: dict = {}, object: dict = {}): print(f"object: {object}") print(f"device_obj: {device_obj}") - print(f"device_obj.name: {getattr(device_obj, "name", "Not specified.")}") - print(f'object.get("name"): {object.get("name", "Not specified.")}') - print(f"device_obj.id: {getattr(device_obj, "id", "Not specified")}") + print(f"device_obj.name: {getattr(device_obj, 'name', 'Not specified.')}") + print(f"object.get('name'): {object.get('name', 'Not specified.')}") + print(f"device_obj.id: {getattr(device_obj, 'id', 'Not specified')}") try: await log(self.websocket, " (1.5.1) Checking duplicate using Device Object as parameter.") @@ -785,7 +785,7 @@ async def _check_duplicate(self, search_params: dict = {}, object: dict = {}): if result_by_name_and_slug: await log( self.websocket, - msg=f" {self.object_name} with ID {getattr(result_by_name_and_slug, "id", 0)} found on Netbox, but without PROXBOX TAG Please delete it (or add the tag) and try again.\nNetbox does not allow duplicated names and/or slugs.", + msg=f" {self.object_name} with ID {getattr(result_by_name_and_slug, 'id', 0)} found on Netbox, but without PROXBOX TAG Please delete it (or add the tag) and try again.\nNetbox does not allow duplicated names and/or slugs.", ) return None diff --git a/netbox_proxbox/backend/routes/netbox/virtualization/cluster.py b/netbox_proxbox/backend/routes/netbox/virtualization/cluster.py index b5d48c7..983578c 100755 --- a/netbox_proxbox/backend/routes/netbox/virtualization/cluster.py +++ b/netbox_proxbox/backend/routes/netbox/virtualization/cluster.py @@ -28,7 +28,7 @@ async def get_base_dict(self): "slug": self.default_slug, "description": self.default_description, "status": "active", - "type": getattr(type, "id", 0) + "type": getattr(type, 'id', 0) } else: await log(self.websocket, f"Failed to fetch cluster type for cluster: {self.default_name}. As it is a required field, the cluster will not be created.") \ No newline at end of file diff --git a/netbox_proxbox/backend/routes/netbox/virtualization/virtual_machines.py b/netbox_proxbox/backend/routes/netbox/virtualization/virtual_machines.py index b92f710..67698ba 100755 --- a/netbox_proxbox/backend/routes/netbox/virtualization/virtual_machines.py +++ b/netbox_proxbox/backend/routes/netbox/virtualization/virtual_machines.py @@ -27,7 +27,7 @@ async def get_base_dict(self): "slug": self.default_slug, "description": self.default_description, "status": "active", - "cluster": getattr(cluster, "id", 0) + "cluster": getattr(cluster, 'id', 0) } else: await log(self.websocket, f"Failed to fetch cluster for virtual machine: {self.default_name}. As it is a required field, the virtual machine will not be created.") \ No newline at end of file