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

WIP

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