This commit consists of:
1) Dockerizing the netconf server
2) Update proto2yang to support module imports
3) Provide a set of yang modules derived from the proto files in voltha.
These files as well as the slight mmodifications to the proto files are
provided in the experiments/netconf/proto2yang directory
4) Code to automatically pull proto files from voltha into the netconf server,
compiles them and produce the yang equivalent files.
5) Add a getvoltha netconf API to provide voltha state information (basic at
this time). There is potential to make this generic once we experiment
with additional APIs
Change-Id: I94f3a1f871b8025ad675d5f9b9b626d1be8b8d36
diff --git a/netconf/nc_rpc/rpc.py b/netconf/nc_rpc/rpc.py
index 3dd2f17..ff9b303 100644
--- a/netconf/nc_rpc/rpc.py
+++ b/netconf/nc_rpc/rpc.py
@@ -18,12 +18,15 @@
#
from rpc_response import RpcResponse
+from lxml import etree
+import io
class Rpc(object):
- def __init__(self,rpc_request, rpc_method, session):
+ def __init__(self,rpc_request, rpc_method, grpc_client, session):
self.rpc_request = rpc_request
self.rpc_method = rpc_method
self.rpc_response = RpcResponse()
+ self.grpc_client = grpc_client
self.session = session
def execute(self):
@@ -36,3 +39,8 @@
def _validate_parameters(self, rpc_request):
"""Sets and validates the node as well"""
pass
+
+ def get_root_element(self, xml_msg):
+ tree = etree.parse(io.BytesIO(xml_msg))
+ return tree.getroot()
+