@@ -326,6 +326,7 @@ def subscribe_module_change(
326
326
passive : bool = False ,
327
327
done_only : bool = False ,
328
328
enabled : bool = False ,
329
+ filter_origin : bool = False ,
329
330
private_data : Any = None ,
330
331
asyncio_register : bool = False ,
331
332
include_implicit_defaults : bool = True ,
@@ -359,6 +360,9 @@ def subscribe_module_change(
359
360
:arg enabled:
360
361
The subscriber wants to be notified about the current configuration
361
362
at the moment of subscribing.
363
+ :arg filter_origin:
364
+ Filter events on the originator side to unburden the subscriber, but
365
+ results in 0 value for filtered-out changes in the subscriber infos.
362
366
:arg private_data:
363
367
Private context passed to the callback function, opaque to sysrepo.
364
368
:arg asyncio_register:
@@ -390,7 +394,11 @@ def subscribe_module_change(
390
394
if asyncio_register :
391
395
no_thread = True # we manage our own event loop
392
396
flags = _subscribe_flags (
393
- no_thread = no_thread , passive = passive , done_only = done_only , enabled = enabled
397
+ no_thread = no_thread ,
398
+ passive = passive ,
399
+ done_only = done_only ,
400
+ enabled = enabled ,
401
+ filter_origin = filter_origin ,
394
402
)
395
403
396
404
check_call (
@@ -444,6 +452,7 @@ def subscribe_module_change_unsafe(
444
452
passive : bool = False ,
445
453
done_only : bool = False ,
446
454
enabled : bool = False ,
455
+ filter_origin : bool = False ,
447
456
private_data : Any = None ,
448
457
asyncio_register : bool = False ,
449
458
) -> None :
@@ -478,6 +487,9 @@ def subscribe_module_change_unsafe(
478
487
:arg enabled:
479
488
The subscriber wants to be notified about the current configuration
480
489
at the moment of subscribing.
490
+ :arg filter_origin:
491
+ Filter events on the originator side to unburden the subscriber, but
492
+ results in 0 value for filtered-out changes in the subscriber infos.
481
493
:arg private_data:
482
494
Private context passed to the callback function, opaque to sysrepo.
483
495
:arg asyncio_register:
@@ -503,7 +515,11 @@ def subscribe_module_change_unsafe(
503
515
if asyncio_register :
504
516
no_thread = True # we manage our own event loop
505
517
flags = _subscribe_flags (
506
- no_thread = no_thread , passive = passive , done_only = done_only , enabled = enabled
518
+ no_thread = no_thread ,
519
+ passive = passive ,
520
+ done_only = done_only ,
521
+ enabled = enabled ,
522
+ filter_origin = filter_origin ,
507
523
)
508
524
check_call (
509
525
lib .sr_module_change_subscribe ,
@@ -1615,7 +1631,12 @@ def _get_oper_flags(no_state=False, no_config=False, no_subs=False, no_stored=Fa
1615
1631
1616
1632
# -------------------------------------------------------------------------------------
1617
1633
def _subscribe_flags (
1618
- no_thread = False , passive = False , done_only = False , enabled = False , oper_merge = False
1634
+ no_thread = False ,
1635
+ passive = False ,
1636
+ done_only = False ,
1637
+ enabled = False ,
1638
+ oper_merge = False ,
1639
+ filter_origin = False ,
1619
1640
):
1620
1641
flags = 0
1621
1642
if no_thread :
@@ -1628,6 +1649,8 @@ def _subscribe_flags(
1628
1649
flags |= lib .SR_SUBSCR_ENABLED
1629
1650
if oper_merge :
1630
1651
flags |= lib .SR_SUBSCR_OPER_MERGE
1652
+ if filter_origin :
1653
+ flags |= lib .SR_SUBSCR_FILTER_ORIG
1631
1654
return flags
1632
1655
1633
1656
0 commit comments