Minor fix
Change-Id: I11251dc72b7704c3524d722ced2ff92519136cb3
diff --git a/netconf/nc_rpc/rpc_factory.py b/netconf/nc_rpc/rpc_factory.py
index f314dbe..d51942c 100644
--- a/netconf/nc_rpc/rpc_factory.py
+++ b/netconf/nc_rpc/rpc_factory.py
@@ -71,14 +71,16 @@
request['filter'] = self.get_attribute_value('type',
elem.attrib)
else:
- request[
- 'command'] = elem_name # attribute is empty for now
+ request['command'] = elem_name # attribute is empty for now
elif elem.tag.find(qmap(C.VOLTHA)) != -1: # found
request['namespace'] = ns(C.VOLTHA)
if request.has_key('class'):
request['subclass'] = elem.tag.replace(qmap(C.VOLTHA),"")
else:
- request['class'] = elem.tag.replace(qmap(C.VOLTHA), "")
+ elem_name = elem.tag.replace(qmap(C.VOLTHA), "")
+ request['class'] = elem_name
+ if not request.has_key('command'):
+ request['command'] = elem_name
elif elem.tag.find(qmap(C.NCM)) != -1: # found
request['namespace'] = ns(C.NCM)
elem_name = elem.tag.replace(qmap(C.NCM), "")
@@ -120,6 +122,7 @@
log.error("rpc-not-implemented", rpc=request['command'])
+
except ncerror.BadMsg as err:
log.info('ncerror.BadMsg')
raise ncerror.BadMsg(rpc_node)
diff --git a/netconf/session/nc_protocol_handler.py b/netconf/session/nc_protocol_handler.py
index 7062250..441c29c 100644
--- a/netconf/session/nc_protocol_handler.py
+++ b/netconf/session/nc_protocol_handler.py
@@ -192,7 +192,7 @@
log.error('no-rpc-handler',
request=msg,
session_id=self.session.session_id)
- error = ncerror.NotImpl(msg)
+ error = ncerror.NotImpl(rpc)
self.send_message(error.get_xml_reply())
except ncerror.BadMsg as err: