napalm-automation-community / napalm-s350

NAPALM driver for Cisco SMB switches (SF3xx, SF5xx, SG3xx, SG5xx).
Apache License 2.0
16 stars 13 forks source link

fix get_facts for switches that dont support output modifiers #3

Closed cspeidel closed 4 years ago

cspeidel commented 5 years ago

Some versions of SG3XX do not support output modifiers e.g. "|".

switch02#show version | include Version
% Wrong number of parameters or invalid range, size or characters entered
switch02#show inventory 
NAME: "1"   DESCR: "SG300-28 28-Port Gigabit Managed Switch"   
PID: SRW2024-K9   VID: V04   SN: <removed> 

This pull request modifies get_facts to pull information without relying on piping.

cspeidel commented 5 years ago

@jasperla is this ok for me to merge? I need your command outputs in order to write test cases for the devices you have.

qaxi commented 4 years ago

I can confirm this bug.

qaxi commented 4 years ago

What command outputs you need for writing tests? I have here wide range of Cisco SMB switches from SF300 to SG550X.

I would like to help, I can send you a lot of testing outputs.

qaxi commented 4 years ago

I can confirm the patch is working.

tested on old SF300-24 24-Port 10/100 Managed Switch sw.ver. 1.4.9.4

jasperla commented 4 years ago

@cspeidel pardon the delay, it seems GH notifications ended up in /dev/null for me; I don't have an SG350 device anymore to test it with. But @qaxi could provide them. I'm OK with merging your diff now and add tests in a separate PR.

cspeidel commented 4 years ago

@qaxi Thank you for testing. I'm glad to hear the patch worked on the SF300. I don't which versions of 350-series are affected, have you had any failures on any of those (or 550 for that matter), without the patch?

cspeidel commented 4 years ago

Patch also confirmed working in https://github.com/napalm-automation-community/napalm-s350/issues/2#issuecomment-463990142