Skip to content

Commit

Permalink
Fix single-quote typo
Browse files Browse the repository at this point in the history
  • Loading branch information
emersonfelipesp committed Nov 26, 2024
1 parent 15ea9c8 commit 10666b1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions netbox_proxbox/backend/routes/netbox/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ async def post(
if response:
await log(
self.websocket,
f"<span class='badge text-bg-red' title='Post'><strong><i class='mdi mdi-upload'></i></strong></span> <strong>{self.object_name}</strong> object created successfully. {self.object_name} ID: {getattr(response, "id", "Not specified.")}"
f"<span class='badge text-bg-red' title='Post'><strong><i class='mdi mdi-upload'></i></strong></span> <strong>{self.object_name}</strong> object created successfully. {self.object_name} ID: {getattr(response, 'id', 'Not specified.')}"
)
return response

Expand Down Expand Up @@ -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, "<span class='badge text-bg-purple' title='Check Duplicate'><i class='mdi mdi-content-duplicate'></i></span> (1.5.1) Checking duplicate using <strong>Device Object</strong> as parameter.")
Expand Down Expand Up @@ -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"<span class='badge text-bg-purple' title='Check Duplicate'><i class='mdi mdi-content-duplicate'></i></span> <strong>{self.object_name}</strong> with ID <strong>{getattr(result_by_name_and_slug, "id", 0)}</strong> found on Netbox, but <strong>without PROXBOX TAG</strong> Please delete it (or add the tag) and try again.\nNetbox does not allow duplicated names and/or slugs.",
msg=f"<span class='badge text-bg-purple' title='Check Duplicate'><i class='mdi mdi-content-duplicate'></i></span> <strong>{self.object_name}</strong> with ID <strong>{getattr(result_by_name_and_slug, 'id', 0)}</strong> found on Netbox, but <strong>without PROXBOX TAG</strong> Please delete it (or add the tag) and try again.\nNetbox does not allow duplicated names and/or slugs.",
)

return None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Original file line number Diff line number Diff line change
Expand Up @@ -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.")

0 comments on commit 10666b1

Please sign in to comment.