Commit cbd44dc8 authored by Joanne Hugé's avatar Joanne Hugé

WIP

parent c09c0c6b
......@@ -24,7 +24,7 @@ md5sum = 6e0a052bd0ca08cc0c7b4880d3deffcc
[lopcomm-rrh-stats.jinja2.py]
_update_hash_filename_ = lopcomm-rrh-stats.jinja2.py
md5sum = 5006bf564f480bd9db7d515a414fc082
md5sum = 00150f71d478672d182832d6eb630267
[template-lte-enb-epc]
_update_hash_filename_ = instance-enb-epc.jinja2.cfg
......
#!{{ python_path }}
import json
import logging
import time
......@@ -29,7 +28,7 @@ class LopcommNetconfClient:
if {{ testing }}:
return
conn = manager.connect(host=host,
self.conn = manager.connect(host=host,
port=port,
username=user,
password=password,
......@@ -39,16 +38,20 @@ class LopcommNetconfClient:
},
hostkey_verify=False)
#result = conn.create_subscription(filter=('xpath', '/o-ran-fm:*'))
sub = conn.create_subscription()
#result = self.conn.create_subscription(filter=('xpath', '/o-ran-fm:*'))
sub = self.conn.create_subscription()
result = None
while result == None:
result = conn.take_notification(block=True, timeout=60)
result = self.conn.take_notification(block=True, timeout=60)
result_in_xml = result._raw
data_dict = xmltodict.parse(result_in_xml)
result_in_json = json.dumps(data_dict)
self.logger.info('', extra={'data': result_in_json})
def close(self):
#self.conn.close()
pass
if __name__ == '__main__':
nc = LopcommNetconfClient()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment