Skip to content

Commit

Permalink
fixes issue with tags assigned to NB objects which were not part of t…
Browse files Browse the repository at this point in the history
…he data model

refs: #120
  • Loading branch information
bb-Ricardo committed Apr 7, 2022
1 parent 5d6bb49 commit a139c7e
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions module/netbox/object_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -764,6 +764,9 @@ def get_tags(self):
"""

tag_list = list()
if "tags" not in self.data_model.keys():
return tag_list

for tag in self.data.get("tags", list()):
if isinstance(tag, NetBoxObject):
tag_name = tag.get_display_name()
Expand Down Expand Up @@ -1290,7 +1293,8 @@ def __init__(self, *args, **kwargs):
self.data_model = {
"name": 50,
"slug": 50,
"description": 200
"description": 200,
"tags": NBTagList
}
super().__init__(*args, **kwargs)

Expand Down Expand Up @@ -1324,7 +1328,8 @@ def __init__(self, *args, **kwargs):
"name": 100,
"slug": 100,
"manufacturer": NBManufacturer,
"description": 200
"description": 200,
"tags": NBTagList
}
super().__init__(*args, **kwargs)

Expand All @@ -1339,7 +1344,8 @@ def __init__(self, *args, **kwargs):
self.data_model = {
"name": 50,
"slug": 50,
"description": 200
"description": 200,
"tags": NBTagList
}
super().__init__(*args, **kwargs)

Expand All @@ -1354,7 +1360,8 @@ def __init__(self, *args, **kwargs):
self.data_model = {
"name": 50,
"slug": 50,
"description": 200
"description": 200,
"tags": NBTagList
}
super().__init__(*args, **kwargs)

Expand All @@ -1371,7 +1378,8 @@ def __init__(self, *args, **kwargs):
"slug": 50,
"color": 6,
"description": 200,
"vm_role": bool
"vm_role": bool,
"tags": NBTagList
}
super().__init__(*args, **kwargs)

Expand Down

0 comments on commit a139c7e

Please sign in to comment.