@@ -52,12 +52,12 @@ class NetconfAgentCallback {
5252 // / @param event The event.
5353 // / @param private_ctx The private context.
5454 // / @return the sysrepo return code.
55- sysrepo::ErrorCode module_change (Session sess,
56- uint32_t /* subscription_id */ ,
57- string_view module_name,
58- optional<string_view> /* sub_xpath */ ,
59- Event event,
60- uint32_t /* request_id */ ) {
55+ sysrepo::ErrorCode moduleChange (Session sess,
56+ uint32_t /* subscription_id */ ,
57+ string_view module_name,
58+ optional<string_view> /* sub_xpath */ ,
59+ Event event,
60+ uint32_t /* request_id */ ) {
6161 ostringstream event_type;
6262 switch (event) {
6363 case Event::Update:
@@ -97,11 +97,11 @@ class NetconfAgentCallback {
9797 }
9898 }
9999
100- void event_notif (Session /* session */ ,
101- uint32_t /* subscription_id */ ,
102- NotificationType const notification_type,
103- optional<DataNode> const notification_tree,
104- NotificationTimeStamp const /* timestamp */ ) {
100+ void eventNotif (Session /* session */ ,
101+ uint32_t /* subscription_id */ ,
102+ NotificationType const notification_type,
103+ optional<DataNode> const notification_tree,
104+ NotificationTimeStamp const /* timestamp */ ) {
105105 string n;
106106 switch (notification_type) {
107107 case NotificationType::Realtime:
@@ -127,9 +127,14 @@ class NetconfAgentCallback {
127127 break ;
128128 }
129129
130- optional<string> const str (
131- notification_tree->printStr (DataFormat::JSON, PrintFlags::WithDefaultsExplicit));
132- string const tree (str ? *str : string ());
130+ string tree;
131+ if (notification_tree) {
132+ optional<string> const str (
133+ notification_tree->printStr (DataFormat::JSON, PrintFlags::WithDefaultsExplicit));
134+ if (str) {
135+ tree = *str;
136+ }
137+ }
133138 LOG_INFO (netconf_logger, NETCONF_NOTIFICATION_RECEIVED)
134139 .arg (n)
135140 .arg (service_pair_.first )
@@ -440,8 +445,8 @@ NetconfAgent::subscribeToDataChanges(const CfgServersMapPair& service_pair) {
440445 Event event,
441446 uint32_t request_id) {
442447 NetconfAgentCallback agent (service_pair);
443- return agent.module_change (session, subscription_id, module_name, sub_xpath, event,
444- request_id);
448+ return agent.moduleChange (session, subscription_id, module_name, sub_xpath, event,
449+ request_id);
445450 };
446451 try {
447452 SubscribeOptions options (SubscribeOptions::Default);
@@ -490,8 +495,8 @@ NetconfAgent::subscribeToNotifications(const CfgServersMapPair& service_pair) {
490495 optional<DataNode> const notification_tree,
491496 NotificationTimeStamp const timestamp) {
492497 NetconfAgentCallback agent (service_pair);
493- return agent.event_notif (session, subscription_id, notification_type, notification_tree,
494- timestamp);
498+ return agent.eventNotif (session, subscription_id, notification_type, notification_tree,
499+ timestamp);
495500 };
496501 try {
497502 auto exception_handler = [model](std::exception& ex) {
0 commit comments