napalm-automation-community / napalm-aos

NAPALM driver for Alcatel Lucent Enterprise AOS
Apache License 2.0
11 stars 13 forks source link

Trailing whitespaces in configurations should be filtered #12

Closed cs-1 closed 6 years ago

cs-1 commented 6 years ago

Due to some strange reason, AOS 8 has trailing whitespaces in configuration lines. This makes merging configuration files difficult. In my eyes napalm-aos should always filter trailing whitespaces present in the running configuration when merging configurations. This makes writing templates much easier.

cs-1 commented 6 years ago

I just realized that there're differences in the QoS configuration of AOS 7 and 8. Depending on the version, a different amount of spaces / whitespaces are inserted in the configuration. Example:

policy service rtp destination udp-port 32512-33023

(AOS 7)

vs.

policy service rtp  destination udp-port 32512-33023

(AOS 8)

Notice the whitespaces after "rtp".

I have no idea why on earth this is different from AOS to AOS (same as with the trailing whitespaces). Someone should really open a case at ALE and have them unify the output and remove trailing and multiple whitespaces from the configuration. Anyhow, for the time being this could be fixed by having napalm-aos remove trailing whitespaces and multiple inline whitespaces.

vmuthukrishnan commented 6 years ago

I am working with the SW Team to address this concern. Could you let me know the exact 7x and 8x version used and the respective platforms?

cs-1 commented 6 years ago

The AOS 7 devices are OS6900-X40 and -X20 w/ AOS 7.3.4.273.R02, and the AOS 8 devices are OS6560-P48Z16 w/ AOS 8.4.1.141.R03 GA. Please note that this is nothing new. AOS 6 devices also had the exact same strangeness. There're whitespaces in places of the configuration where they make no sense at all (at the end of a line or several ones in between keywords in a single line). It drives you nuts if you do automatic configuration management. In my eyes the only correct way to fix this would be to fix AOS to remove all superfluous whitespaces.

napalmaos commented 6 years ago

Hi, Please help to test again. If it doesn't work with you, please help to share your *.yml file and output. Thanks,

cs-1 commented 6 years ago

Hi, the patch works, thanks!