cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
316
Views
0
Helpful
1
Replies

Question about applying template in cb_create function

previousqna
Level 5
Level 5

All ,

I have the need to apply a template within cb_create but then adjust some values of the service object before returning from cb_create.

i.e.

template = ncs.template.Template(service)

template.apply('xyz-template', vars)

service.status = somefunction()

It appears the service.status leaf doesn’t get assigned the value.

I suspect the template.apply() is closing out a transaction so any later attempts of modifying the service object are ignored?

I could reopen a new transaction after template.apply() but that seems messy.

Just curious if anyone knows what is happening in the background.

1 Reply 1

previousqna
Level 5
Level 5

Hi,

A service’s create-cb should not be touching the service configs. Badness.

Also, note, every time service’s create-cb is called, it should recreate the device mappings.

Looks like the Plan component can help?