When i try to execute Device.cli(....) command from python it gives me wrong output. What could be the issue?
For example, if i execute below command on directly on Juniper Device CLI, it gives the correct output with match sadasd-sdasd-asdasd.
show configuration | display set | match sadasd-sdasd-asdasd
But if i execute the same command from Junos CLI with python, output is whole configuration instead of matching with filter string.
device = Device(host=host, user=device_ssh_user, ssh_private_key_file=device_ssh_key,
passwd=password)
device.open()
configuration = device.cli("show configuration | display set | match sadasd-sdasd-asdasd")
It is not recommended to use the cli() method in Pyez. Why? Read the below answer.
Already answered here