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

WIP

parent 2eb3e0dd
......@@ -24,7 +24,7 @@ md5sum = 6e0a052bd0ca08cc0c7b4880d3deffcc
[lopcomm-rrh-stats.jinja2.py]
_update_hash_filename_ = lopcomm-rrh-stats.jinja2.py
md5sum = fdadec073c6beec2082d57114eb7fa86
md5sum = dc58a06cbfef97a0a04dbada9b91e65c
[template-lte-enb-epc]
_update_hash_filename_ = instance-enb-epc.jinja2.cfg
......
......@@ -35,7 +35,7 @@ class LopcommNetconfClient:
if {{ testing }}:
return
logger.info('Connecting to %s, user %s...' % ((host, port), user))
self.logger.info('Connecting to %s, user %s...' % ((host, port), user))
self.conn = manager.connect(host=host,
port=port,
......@@ -47,23 +47,23 @@ class LopcommNetconfClient:
},
hostkey_verify=False)
logger.info('Connection to %s successful' % ((host, port),))
self.logger.info('Connection to %s successful' % ((host, port),))
def subscribe(self):
# Filter not compatible between ncclient and netconf server
#result = self.conn.create_subscription(filter=('xpath', '/o-ran-fm:*'))
sub = self.conn.create_subscription()
logger.info('Subscription to %s successful' % ((host, port),))
self.logger.info('Subscription to %s successful' % ((host, port),))
def get_notification(self):
result = None
while result == None:
logger.debug('Waiting for notification from %s...' % ((host, port),))
self.logger.debug('Waiting for notification from %s...' % ((host, port),))
result = self.conn.take_notification(block=True)
if result:
logger.debug('Got new notification from %s...' % ((host, port),))
self.logger.debug('Got new notification from %s...' % ((host, port),))
result_in_xml = result._raw
data_dict = xmltodict.parse(result_in_xml)
result_in_json = json.dumps(data_dict)
......
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