napalm-automation-community / napalm-aos

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

get_config() returns startup/running diff instead of empty string #26

Closed jrschneider closed 3 years ago

jrschneider commented 5 years ago

The docstring for get_config() indicates that an empty string will be returned for the candidate config since AOS does not support the concept. I was very confused when a diff of the startup/running config was returned.

https://github.com/napalm-automation-community/napalm-aos/blob/26c553e92b2fa1d48e5e2c9e69d93e460748d48b/napalm_aos/aos.py#L1136-L1143

https://github.com/napalm-automation-community/napalm-aos/blob/26c553e92b2fa1d48e5e2c9e69d93e460748d48b/napalm_aos/aos.py#L1157-L1163

I would expect a line like the one below rather than the blob above generating a diff.

configs['candidate'] = ''

While I appreciate the idea, it doesn't match the behavior that is documented or that NAPALM core expects in other drivers.

napalmaos commented 5 years ago

You are right that AOS doesn't support candidate configuration.

The document of NAPALM core (https://napalm.readthedocs.io/en/latest/base.html#napalm.base.base.NetworkDriver.get_config) suggest that:

candidate(string) - Representation of the native candidate configuration. If the device doesnt differentiate between running and startup configuration this will an empty string.

We want to return a diff between startup and running configuration. It's the way to help user know what is different when rebooting switch. You can simply ignore it.

vmuthukrishnan commented 5 years ago

@jrschneider If there are no further queries, could you close the ticket?

vmuthukrishnan commented 3 years ago

Issue is resolved