Skip to content

Commit 6dfd760

Browse files
authored
Update client.py
Added support for 'target' field in the response.
1 parent 16de76c commit 6dfd760

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pygnmi/client.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,10 @@ def get(self, prefix: str = "", path: list = None, target: str = None, datatype:
479479
{"alias": notification.alias}
480480
) if notification.alias else notification_container.update({"alias": None})
481481

482+
notification_container.update(
483+
{"target": notification.prefix.target}
484+
) if notification.prefix.target else notification_container.update({"target": None})
485+
482486
# Message Notification, Key atomic
483487
notification_container.update({"atomic": notification.atomic})
484488

@@ -651,6 +655,11 @@ def set(
651655
{"prefix": gnmi_path_degenerator(gnmi_message_response.prefix)}
652656
) if gnmi_message_response.prefix else response.update({"prefix": None})
653657

658+
# Message SetResponse, Key target
659+
response.update(
660+
{"target": gnmi_message_response.prefix.target}
661+
) if gnmi_message_response.prefix.target else response.update({"target": None})
662+
654663
if gnmi_message_response.response:
655664
response.update({"response": []})
656665

0 commit comments

Comments
 (0)