Skip to content

Commit

Permalink
fixes issue with rewriting device role 'Server' color #319
Browse files Browse the repository at this point in the history
  • Loading branch information
bb-Ricardo committed Jun 19, 2023
1 parent 7d29c62 commit a2f8385
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion module/netbox/object_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,6 @@ def update(self, data=None, read_from_netbox=False, source=None):
# which is already saved in NetBox
elif self._original_data.get(key) is None:
self._original_data[key] = current_value_str
print(self._original_data[key])

new_value_str = new_value_str.replace("\n", " ")
log.info(f"{self.name.capitalize()} '{display_name}' attribute '{key}' changed from "
Expand Down
10 changes: 5 additions & 5 deletions module/sources/vmware/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -2409,10 +2409,10 @@ def update_basic_data(self):
server_role_object = self.inventory.get_by_data(NBDeviceRole, data={"name": "Server"})

if server_role_object is not None:
server_role_object.update(data={
"name": "Server",
"color": "9e9e9e",
"vm_role": True
})
role_data = {"name": "Server", "vm_role": True}
if server_role_object.is_new is True:
role_data["color"] = "9e9e9e"

server_role_object.update(data=role_data)

# EOF

0 comments on commit a2f8385

Please sign in to comment.