@@ -45,13 +45,13 @@ def test_module_change_sub(self):
45
45
expected_changes = []
46
46
47
47
def module_change_cb (event , req_id , changes , private_data ):
48
- self .assertIn (event , ("change" , "done" , "abort" ))
48
+ self .assertIn (event , ("change" , "done" , "abort" , "update" ))
49
49
self .assertIs (private_data , priv )
50
50
for c in changes :
51
51
if c .xpath == "/sysrepo-example:conf/system/hostname" :
52
52
if event == "change" and c .value == "INVALID" :
53
53
raise sysrepo .SysrepoValidationFailedError ("invalid hostname" )
54
- if event in ("change" , "done" ):
54
+ if event in ("change" , "done" , "update" ):
55
55
self .assertEqual (changes , expected_changes )
56
56
if event == "done" :
57
57
sysrepo .update_config_cache (current_config , changes )
@@ -61,6 +61,7 @@ def module_change_cb(event, req_id, changes, private_data):
61
61
"/sysrepo-example:conf" ,
62
62
module_change_cb ,
63
63
private_data = priv ,
64
+ update = True ,
64
65
)
65
66
66
67
with self .conn .start_session ("running" ) as ch_sess :
@@ -316,15 +317,15 @@ def test_module_change_sub_unsafe(self):
316
317
317
318
def module_change_cb (session , event , req_id , private_data ):
318
319
self .assertIsInstance (session , SysrepoSession )
319
- self .assertIn (event , ("change" , "done" , "abort" ))
320
+ self .assertIn (event , ("change" , "done" , "abort" , "update" ))
320
321
self .assertIsInstance (req_id , int )
321
322
self .assertIs (private_data , priv )
322
323
changes = list (session .get_changes ("/sysrepo-example:conf//." ))
323
324
for c in changes :
324
325
if c .xpath == "/sysrepo-example:conf/system/hostname" :
325
326
if event == "change" and c .value == "INVALID" :
326
327
raise sysrepo .SysrepoValidationFailedError ("invalid hostname" )
327
- if event in ("change" , "done" ):
328
+ if event in ("change" , "done" , "update" ):
328
329
self .assertEqual (changes , expected_changes )
329
330
if event == "done" :
330
331
sysrepo .update_config_cache (current_config , changes )
@@ -334,6 +335,7 @@ def module_change_cb(session, event, req_id, private_data):
334
335
"/sysrepo-example:conf" ,
335
336
module_change_cb ,
336
337
private_data = priv ,
338
+ update = True ,
337
339
)
338
340
339
341
with self .conn .start_session ("running" ) as ch_sess :
0 commit comments