Skip to content

Commit a70844a

Browse files
jeanseb6windrjarry
authored andcommitted
session: support oper_merge flag
This flag is needed when mixing pushed and pulled oper-data requests in the method subscribe_oper_data_request.
1 parent c089d1c commit a70844a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

sysrepo/session.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,7 @@ def subscribe_oper_data_request(
401401
callback: OperDataCallbackType,
402402
*,
403403
no_thread: bool = False,
404+
oper_merge: bool = False,
404405
private_data: Any = None,
405406
asyncio_register: bool = False,
406407
strict: bool = False,
@@ -420,6 +421,11 @@ def subscribe_oper_data_request(
420421
:arg no_thread:
421422
There will be no thread created for handling this subscription meaning no
422423
event will be processed! Default to `True` if asyncio_register is `True`.
424+
:arg oper_merge:
425+
Instead of removing any previous existing matching data before
426+
getting them from an operational subscription callback, keep
427+
them. Then the returned data are merged into the existing
428+
data. Valid only for operational subscriptions.
423429
:arg private_data:
424430
Private context passed to the callback function, opaque to sysrepo.
425431
:arg asyncio_register:
@@ -448,7 +454,7 @@ def subscribe_oper_data_request(
448454

449455
if asyncio_register:
450456
no_thread = True # we manage our own event loop
451-
flags = _subscribe_flags(no_thread=no_thread)
457+
flags = _subscribe_flags(no_thread=no_thread, oper_merge=oper_merge)
452458

453459
check_call(
454460
lib.sr_oper_get_subscribe,

0 commit comments

Comments
 (0)