Commit 4bc14c73 authored by Lu Xu's avatar Lu Xu 👀

wip

parent b1c9c7e0
......@@ -36,7 +36,7 @@ md5sum = b34fe47a73890097fbc6ea6374aeb38d
[lopcomm-rrh-software.jinja2.py]
_update_hash_filename_ = lopcomm-rrh-software.jinja2.py
md5sum = f66787b7c94e5d44ef70997141f20192
md5sum = a41653f586ce17c2d77ef1b0fb86b8a4
[template-enb]
_update_hash_filename_ = instance-enb.jinja2.cfg
......@@ -112,7 +112,7 @@ md5sum = 2660e02c5afb3e86436282efa9f9fbc4
[software_install.jinja2.xml]
filename = netconf/software_install.jinja2.xml
md5sum = 9efdb301023149d3785c814fb5a5318f
md5sum = eda80231b0417d3e6391abfaa1b9cf29
[software.cfg.html]
_update_hash_filename_ = gadget/software.cfg.html
......
......@@ -46,14 +46,14 @@ class LopcommNetconfClient:
self.logger.info('Connection to %s successful' % (self.address,))
def edit_config(self, config_files):
for config_file in config_files:
with open(config_file) as f:
config_xml = f.read()
def rpc_request(self, rpc_files):
for rpc_file in rpc_files:
with open(rpc_file) as f:
rpc_xml = f.read()
try:
self.logger.info('Sending software management RPC request...')
self.conn.edit_config(target='running', config=config_xml)
self.conn.rpc(target='running', config=rpc_xml)
self.logger.info('Software management RPC request sent successfully')
except RPCError as e:
self.logger.error('Error sending software management RPC request: %s' % e)
......@@ -68,7 +68,7 @@ if __name__ == '__main__':
while True:
try:
nc.connect("{{ netaddr.IPAddress(slap_configuration.get('tap-ipv6-gateway', '')) }}", 830, "oranuser", "oranpassword")
nc.edit_config(["{{ CreateProcessingEle_template }}", "{{ cu_config_template }}"])
nc.rpc_request(["{{ software_install_template }}"])
break
except Exception as e:
nc.logger.debug('Got exception, waiting 10 seconds before reconnecting...')
......
<software-install xmlns="urn:o-ran:software-management:1.0">
<config xmlns="urn:o-ran:software-management:1.0">
<slot-name>slot-2</slot-name>
<file-names>PR.PRM61C70V1002.K010927.tar.g</file-names>
</software-install>
\ No newline at end of file
</config>
\ No newline at end of file
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