File tree Expand file tree Collapse file tree 3 files changed +7
-6
lines changed
Expand file tree Collapse file tree 3 files changed +7
-6
lines changed Original file line number Diff line number Diff line change 115115input ("Press Enter for Set update..." )
116116set_update = proto .gnmi_pb2 .Update ()
117117# This is the fully modeled JSON we want to update with
118- update_json = json .loads ("""
118+ update_json = json .loads (
119+ """
119120{
120121 "openconfig-interfaces:interfaces": {
121122 "interface": [
125126 ]
126127 }
127128}
128- """ )
129+ """
130+ )
129131# Let's just do an update from the very top element
130132top_element = next (iter (update_json .keys ()))
131133set_update .path .CopyFrom (client .parse_xpath_to_gnmi_path (top_element ))
135137set_update .val .json_ietf_val = json .dumps (update_json ).encode ("utf-8" )
136138set_result = client .set (updates = [set_update ])
137139print (set_result )
138- # This may all seem somewhat obtuse, and that's what the client wrappers are for.
140+ # This may all seem somewhat obtuse, and that's what the client wrappers are for.
Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ class ClientBuilder(object):
8282 "NX-OS" : NXClient ,
8383 "NX" : NXClient ,
8484 "IOS XE" : XEClient ,
85- "XE" : XEClient
85+ "XE" : XEClient ,
8686 }
8787
8888 def __init__ (self , target ):
Original file line number Diff line number Diff line change @@ -64,8 +64,7 @@ def main():
6464
6565See <rpc> --help for RPC options.
6666 """ .format (
67- version = __version__ ,
68- supported_rpcs = "\n " .join (sorted (list (rpc_map .keys ())))
67+ version = __version__ , supported_rpcs = "\n " .join (sorted (list (rpc_map .keys ())))
6968 ),
7069 )
7170 parser .add_argument ("rpc" , help = "gNMI RPC to perform against network element." )
You can’t perform that action at this time.
0 commit comments