Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ApplyConfigletToDevice does not create TempAction if configlet is already on device. #73

Open
hansbogert opened this issue Dec 15, 2020 · 5 comments

Comments

@hansbogert
Copy link

hansbogert commented Dec 15, 2020

IIUC, ApplyConfigletToDevice does two things:

  • actually set the configlet on a a device.
  • create a tempaction

However this function does not create a tempaction when the configlet is already on the device. In fact, with the current functions in go-cvprac, I have no idea how to create a tempaction now in the scenario that a device already holds a configlet, but does not have an accompanying tempaction yet.

Note that this behaviour does not seem to be in the Python version of cvprac.

@cheynearista
Copy link
Contributor

@hansbogert If the configlet exists, then you should be able to use UpdateConfigletWaitForTask() which will update the configlet and create a task if there is an actual change in the configuration.

@hansbogert
Copy link
Author

I see, but in my case there isn't even an update to the configlet. Imo, the semantics of the function are wrong, and I think the python version got it right.

@hansbogert
Copy link
Author

I probably should've stipulated this in the OP, but the situation is as described plus,

the running configuration differs from the designed configuration.

@cheynearista
Copy link
Contributor

Can you explain more on how the python version got it right? We try to have parity between the python and golang libraries as best we can.

@hansbogert
Copy link
Author

hansbogert commented Dec 15, 2020

In the go version you exit if the action var is false, no TempAction will be created

In the python version, there is no similar construct and the TempAction is made unconditionally. Which makes sense in my exact situation, when a configlet is added to a device, but there isn't an accompanying TempAction yet.

I think the go version is trying to prematurely optimize in this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants