Skip to content

Commit

Permalink
Merge pull request #155 from rao-aneesh/patch-4
Browse files Browse the repository at this point in the history
Add support for 'target' field in the SET and GET responses.
  • Loading branch information
akarneliuk authored Apr 3, 2024
2 parents 8ffec7b + a311176 commit 21f6285
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pygnmi/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,11 @@ def get(
else notification_container.update({"alias": None})
)

# Message Notification, Key target
notification_container.update(
{"target": notification.prefix.target}
) if notification.prefix.target else notification_container.update({"target": None})

# Message Notification, Key atomic
notification_container.update({"atomic": notification.atomic})

Expand Down Expand Up @@ -709,6 +714,11 @@ def set(
else response.update({"prefix": None})
)

# Message SetResponse, Key target
response.update(
{"target": gnmi_message_response.prefix.target}
) if gnmi_message_response.prefix.target else response.update({"target": None})

if gnmi_message_response.response:
response.update({"response": []})

Expand Down

0 comments on commit 21f6285

Please sign in to comment.