12-13-2023 10:31 AM
I'd like to persist some data in proplist in my service, in cb_create() I have proplist.append((service.name, str(index)) where index is allocated in cb_create(). The commit was successful. But when the config was updated again, in cb_pre_modification() the proplist became empty:
def cb_create(self, tctx, root, service, proplist):
if service.profile.index is None:
service.profile.index = self._allocate_index(root)
proplist.append((service.name, str(service.profile.index))
def cb_pre_modification(self, tctx, op, kp, root, proplist):
if op == _ncs.dp.NCS_SERVICE_UPDATE:
service = ncs.maagic.cd(root, kp)
profiles = dict(proplist)
print(profiles) <-- empty
…
Wonder if I did anything wrong with proplist, can't find much information in NSO document on proplist.
Solved! Go to Solution.
12-13-2023 01:51 PM
12-13-2023 01:51 PM
12-14-2023 06:37 AM
Aha, that's it, it works now with "return proplist". Thanks!
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide