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

WIP

parent c09c0c6b
...@@ -24,7 +24,7 @@ md5sum = 6e0a052bd0ca08cc0c7b4880d3deffcc ...@@ -24,7 +24,7 @@ md5sum = 6e0a052bd0ca08cc0c7b4880d3deffcc
[lopcomm-rrh-stats.jinja2.py] [lopcomm-rrh-stats.jinja2.py]
_update_hash_filename_ = lopcomm-rrh-stats.jinja2.py _update_hash_filename_ = lopcomm-rrh-stats.jinja2.py
md5sum = 5006bf564f480bd9db7d515a414fc082 md5sum = 00150f71d478672d182832d6eb630267
[template-lte-enb-epc] [template-lte-enb-epc]
_update_hash_filename_ = instance-enb-epc.jinja2.cfg _update_hash_filename_ = instance-enb-epc.jinja2.cfg
......
#!{{ python_path }} #!{{ python_path }}
import json import json
import logging import logging
import time import time
...@@ -29,7 +28,7 @@ class LopcommNetconfClient: ...@@ -29,7 +28,7 @@ class LopcommNetconfClient:
if {{ testing }}: if {{ testing }}:
return return
conn = manager.connect(host=host, self.conn = manager.connect(host=host,
port=port, port=port,
username=user, username=user,
password=password, password=password,
...@@ -39,16 +38,20 @@ class LopcommNetconfClient: ...@@ -39,16 +38,20 @@ class LopcommNetconfClient:
}, },
hostkey_verify=False) hostkey_verify=False)
#result = conn.create_subscription(filter=('xpath', '/o-ran-fm:*')) #result = self.conn.create_subscription(filter=('xpath', '/o-ran-fm:*'))
sub = conn.create_subscription() sub = self.conn.create_subscription()
result = None result = None
while 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 result_in_xml = result._raw
data_dict = xmltodict.parse(result_in_xml) data_dict = xmltodict.parse(result_in_xml)
result_in_json = json.dumps(data_dict) result_in_json = json.dumps(data_dict)
self.logger.info('', extra={'data': result_in_json}) self.logger.info('', extra={'data': result_in_json})
def close(self):
#self.conn.close()
pass
if __name__ == '__main__': if __name__ == '__main__':
nc = LopcommNetconfClient() 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