Skip to content
This repository has been archived by the owner on Dec 1, 2023. It is now read-only.

Commit

Permalink
Merge pull request #164 from Eric-Jckson/tag2.0_fix
Browse files Browse the repository at this point in the history
Updated fix for the get device tags function
  • Loading branch information
qduk authored Sep 12, 2023
2 parents c4b3f3c + c8ff4e9 commit 80c010c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion nautobot_ssot_aristacv/tests/test_utils_cloudvision.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def test_get_device_tags(self):
mock_tag.value.device_id.value = "JPE12345678"

tag_stub = MagicMock()
tag_stub.TagAssignmentConfigServiceStub.return_value.GetAll.return_value = [mock_tag]
tag_stub.TagAssignmentServiceStub.return_value.GetAll.return_value = [mock_tag]

with patch("nautobot_ssot_aristacv.utils.cloudvision.tag_services", tag_stub):
results = cloudvision.get_device_tags(client=self.client, device_id="JPE12345678")
Expand Down
4 changes: 3 additions & 1 deletion nautobot_ssot_aristacv/utils/cloudvision.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,12 +308,14 @@ def get_tags_by_type(client, creator_type: int = tag_models.CREATOR_TYPE_USER):

def get_device_tags(client, device_id: str):
"""Get tags for specific device."""
tag_stub = tag_services.TagAssignmentConfigServiceStub(client)
tag_stub = tag_services.TagAssignmentServiceStub(client)
req = tag_services.TagAssignmentConfigStreamRequest(
partial_eq_filter=[
tag_models.TagAssignmentConfig(
key=tag_models.TagAssignmentKey(
device_id=StringValue(value=device_id),
element_type=tag_models.ELEMENT_TYPE_DEVICE,
workspace_id=StringValue(value=""),
)
)
]
Expand Down

0 comments on commit 80c010c

Please sign in to comment.