Open hansbogert opened 3 years ago
@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.
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.
I probably should've stipulated this in the OP, but the situation is as described plus,
the running configuration differs from the designed configuration.
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.
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.
IIUC,
ApplyConfigletToDevice
does two things: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.