question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Nokia SR-OS classical CLI doesn't let you set global_cmd_verify (i.e. it is always hard-coded to False).

See original GitHub issue

Hi. I’m in the process of migrating my tools to netmiko 4.1.0. I’m wondering if send_config_set() is behaving as before. This is how send config commands to the router, where inCmds is a list of commands.

So, the commands I’m sending to the router are the following…

echo SCRIPT_NONO_START

/environment no more
/configure router interface loop8 loopback
/configure router interface loop8 address 11.11.11.23/32
exit all
echo SCRIPT_NONO_FIN

And this is how I send those by means of the function send_config_set():

inCmds = ['echo SCRIPT_NONO_START', '', '/environment no more', '/configure router interface loop8 loopback', '/configure router interface loop8 address 11.11.11.23/32', 'exit all', 'echo SCRIPT_NONO_FIN', '']
outputTxt = conn2rtr.send_config_set(config_commands=inCmds, enter_config_mode=False, cmd_verify=True, read_timeout=10)

However, when lookin at the debug shown by netmiko, it seems to me that netmiko is sending the commands as a bulk operation.

DEBUG:netmiko:[find_prompt()]: prompt is *A:myRouter#
DEBUG:netmiko:write_channel: b'echo SCRIPT_NONO_START\n'
DEBUG:netmiko:write_channel: b'\n'
DEBUG:netmiko:write_channel: b'/environment no more\n'
DEBUG:netmiko:write_channel: b'/configure router interface loop8 loopback\n'
DEBUG:netmiko:write_channel: b'/configure router interface loop8 address 11.11.11.23/32\n'
DEBUG:netmiko:write_channel: b'exit all\n'
DEBUG:netmiko:write_channel: b'echo SCRIPT_NONO_FIN\n'
DEBUG:netmiko:write_channel: b'\n'
DEBUG:netmiko:read_channel: echo SCRIPT_NONO_START 
SCRIPT_NONO_START
*A:myRouter# 
*A:myRouter# /environment no more 
*A:myRouter# /configure router interface "loop8" loopback 
*A:myRouter# /configure router interface "loop8" address 11.11.11.23/32 
*A:
DEBUG:netmiko:read_channel: myRouter# exit all 
*A:myRouter# echo SCRIPT_NONO_FIN 

DEBUG:netmiko:read_channel: SCRIPT_NONO_FIN
*A:myRouter# 
DEBUG:netmiko:read_channel: 
DEBUG:netmiko:read_channel: 
DEBUG:netmiko:write_channel: b'exit all\n'
DEBUG:netmiko:read_channel: 
DEBUG:netmiko:read_channel: 
DEBUG:netmiko:read_channel: 
DEBUG:netmiko:read_channel: 
DEBUG:netmiko:read_channel: 
DEBUG:netmiko:read_channel: exit all 

Is that so? I don’t have a log with me at this moment, but I’m pretty sure that netmiko 3.4.0 would perform a command verify per each individual command in the list provided to send_config_set(). I know that, because with 3.4.0 if there was any difference between the sent command with respect to the echo, netmiko would complain. And now it is not happening …

For example: I’m sending (on purpose) the line configure router interface loop8 loopback and the router is echoing configure router interface "loop8" loopback (note the "" on the interface name). Before this would imply an error; it is not happening now…

Regards!

Lucas

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
ktbyerscommented, Jul 25, 2022

Should be fixed…thanks for your contribution on this @laimaretto

1reaction
ktbyerscommented, Jun 28, 2022

LOL, I messed that up also…yep, you are totally right.

Read more comments on GitHub >

github_iconTop Results From Across the Web

1. Using the MD-CLI - Nokia Documentation
To enable the MD-CLI engine from the classic CLI, perform the following steps: Set the configuration mode to model-driven and leave cli-engine unconfigured....
Read more >
7750 SR OS Basic System Configuration Guide
7750 SR OS Basic System Configuration Guide. The CLI returns an error message when the syntax is incorrect. *A:ALA-12>config# rooter. Error: Bad command....
Read more >
4. Configuring in the MD-CLI
When the MD-CLI session is in operational mode, the configure command only accepts a configuration mode parameter and cannot be followed by a...
Read more >
Configuring Global Service Entities with CLI
When you configure a distributed service, you must identify an SDP ID. Use the show service sdp command to display the qualifying SDPs....
Read more >
3. Classic and Model-Driven Management Interfaces
Model-driven management interfaces include: the MD-CLI. NETCONF using the Nokia SR OS YANG modules. the gRPC Network Management Interface (gNMI).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found