Commit 99b96054 authored by Lu Xu's avatar Lu Xu 👀

sw upgrading wip

parent 369d4432
...@@ -40,7 +40,7 @@ md5sum = 20764fa7554d90d040f3847a9573ef93 ...@@ -40,7 +40,7 @@ md5sum = 20764fa7554d90d040f3847a9573ef93
[lopcomm-rrh-software.jinja2.py] [lopcomm-rrh-software.jinja2.py]
_update_hash_filename_ = lopcomm-rrh-software.jinja2.py _update_hash_filename_ = lopcomm-rrh-software.jinja2.py
md5sum = 673516819477d924f94315ffc734a1cc md5sum = 126641b08c026206d8728a20135eb964
[template-enb] [template-enb]
_update_hash_filename_ = instance-enb.jinja2.cfg _update_hash_filename_ = instance-enb.jinja2.cfg
......
...@@ -118,10 +118,14 @@ ...@@ -118,10 +118,14 @@
"textarea": true, "textarea": true,
"type": "string" "type": "string"
}, },
"customised_download_rpc_xml": { "sftp_remote_file_path": {
"title": "Firmware Download XML", "title": "SFTP Remote file path",
"description": "Customised firmware download XML", "description": "SFTP Remote file path. e.g. sftp://user@ip_address:port:/path/to/file",
"textarea": true, "type": "string"
},
"sftp_remote_file_path_password": {
"title": "SFTP Remote file path password",
"description": "SFTP Remote file path password",
"type": "string" "type": "string"
}, },
"firmware_name": { "firmware_name": {
......
...@@ -117,10 +117,14 @@ ...@@ -117,10 +117,14 @@
"textarea": true, "textarea": true,
"type": "string" "type": "string"
}, },
"customised_download_rpc_xml": { "sftp_remote_file_path": {
"title": "Firmware Download XML", "title": "SFTP Remote file path",
"description": "Customised firmware download XML", "description": "SFTP Remote file path. e.g. sftp://user@ip_address:port:/path/to/file",
"textarea": true, "type": "string"
},
"sftp_remote_file_path_password": {
"title": "SFTP Remote file path password",
"description": "SFTP Remote file path password",
"type": "string" "type": "string"
}, },
"firmware_name": { "firmware_name": {
......
...@@ -26,23 +26,30 @@ if __name__ == '__main__': ...@@ -26,23 +26,30 @@ if __name__ == '__main__':
if running_slot_name and nonrunning_slot_name: if running_slot_name and nonrunning_slot_name:
if running_slot_name: if running_slot_name:
nc.logger.info("One slot is running and one is non-running. Proceeding...") nc.logger.info("One slot is running and one is non-running. Proceeding...")
{% if slapparameter_dict.get('customised_download_rpc_xml') %} {% if slapparameter_dict.get('sftp_remote_file_path') %}
{% set firmware_name = slapparameter_dict.get('firmware_name') %} {% set firmware_name = slapparameter_dict.get('firmware_name') %}
{% set remote_file_path = slapparameter_dict.get('sftp_remote_file_path') %}
{% else %} {% else %}
{% set firmware_name = "{{ firmware_name }}" %} {% set firmware_name = "{{ firmware_name }}" %}
{% set remote_file_path = {{ remote_file_path }} %}
{% endif %} {% endif %}
if running_slot_name_build_version in firmware_name: if running_slot_name_build_version in firmware_name:
nc.logger.info("Running slot's build-version %s is already updated. Skipping install." % running_slot_name_build_version) nc.logger.info("Running slot's build-version %s is already updated. Skipping install." % running_slot_name_build_version)
else: else:
nc.logger.info("Current build version: %s" % running_slot_name_build_version) nc.logger.info("Current build version: %s" % running_slot_name_build_version)
{% if slapparameter_dict.get('customised_download_rpc_xml') %} {% if slapparameter_dict.get('sftp_remote_file_path') %}
download_rpc_xml = f""" download_rpc_xml = f"""
{{ slapparameter_dict.get('customised_download_rpc_xml') }} <software-download xmlns="urn:o-ran:software-management:1.0">
<remote-file-path>{ remote_file_path }/{firmware_name}</remote-file-path>
<password>
<password>{{slapparameter_dict.get('sftp_remote_file_path_password')}}</password>
</password>
</software-download>
""" """
{% else %} {% else %}
download_rpc_xml = f""" download_rpc_xml = f"""
<software-download xmlns="urn:o-ran:software-management:1.0"> <software-download xmlns="urn:o-ran:software-management:1.0">
<remote-file-path>{{ remote_file_path }}/{firmware_name}</remote-file-path> <remote-file-path>{ remote_file_path }/{firmware_name}</remote-file-path>
</software-download> </software-download>
""" """
{% endif %} {% endif %}
......
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