Commit 689b4eee authored by Lu Xu's avatar Lu Xu 👀

firmware 1004

parent 99b96054
......@@ -40,11 +40,11 @@ md5sum = 20764fa7554d90d040f3847a9573ef93
[lopcomm-rrh-software.jinja2.py]
_update_hash_filename_ = lopcomm-rrh-software.jinja2.py
md5sum = 126641b08c026206d8728a20135eb964
md5sum = 68f84ba07ca933f83671989f8d9a08f4
[template-enb]
_update_hash_filename_ = instance-enb.jinja2.cfg
md5sum = d33c06a2bc32796af4fa3064380d2544
md5sum = 3d9e8750dee109ffbf449e2ce9c72747
[template-gnb]
_update_hash_filename_ = instance-gnb.jinja2.cfg
......
......@@ -118,21 +118,6 @@
"textarea": true,
"type": "string"
},
"sftp_remote_file_path": {
"title": "SFTP Remote file path",
"description": "SFTP Remote file path. e.g. sftp://user@ip_address:port:/path/to/file",
"type": "string"
},
"sftp_remote_file_path_password": {
"title": "SFTP Remote file path password",
"description": "SFTP Remote file path password",
"type": "string"
},
"firmware_name": {
"title": "Lopcomm Firmware Name",
"description": "Lopcomm firmware name. It is used to compare the current running version.",
"type": "string"
},
{%- endif %}
"log_phy_debug": {
"title": "Physical layer log debug",
......
......@@ -325,9 +325,9 @@ hash-files =
[lopcomm-firmware-dl]
recipe = slapos.recipe.build:download
url = https://lab.nexedi.com/nexedi/ors-utils/raw/master/lopcomm-firmware/PR.PRM61C70V1003.tar.gz
filename = PR.PRM61C70V1003.tar.gz
md5sum = 0d07cf68b1364df4e160ed7d2a45d272
url = https://lab.nexedi.com/nexedi/ors-utils/raw/master/lopcomm-firmware/${:filename}
filename = PR.PRM61C70V1004.002.tar.gz
md5sum = 4e06fd62968f9f53fd819ef8d880a8f4
destination = ${directory:etc}/${:filename}
offline = false
......
......@@ -117,21 +117,6 @@
"textarea": true,
"type": "string"
},
"sftp_remote_file_path": {
"title": "SFTP Remote file path",
"description": "SFTP Remote file path. e.g. sftp://user@ip_address:port:/path/to/file",
"type": "string"
},
"sftp_remote_file_path_password": {
"title": "SFTP Remote file path password",
"description": "SFTP Remote file path password",
"type": "string"
},
"firmware_name": {
"title": "Lopcomm Firmware Name",
"description": "Lopcomm firmware name. It is used to compare the current running version.",
"type": "string"
},
"log_phy_debug": {
"title": "Physical layer log debug",
"description": "Enable debug mode for physical layer logs",
......
......@@ -26,33 +26,15 @@ if __name__ == '__main__':
if running_slot_name and nonrunning_slot_name:
if running_slot_name:
nc.logger.info("One slot is running and one is non-running. Proceeding...")
{% if slapparameter_dict.get('sftp_remote_file_path') %}
{% set firmware_name = slapparameter_dict.get('firmware_name') %}
{% set remote_file_path = slapparameter_dict.get('sftp_remote_file_path') %}
{% else %}
{% set firmware_name = "{{ firmware_name }}" %}
{% set remote_file_path = {{ remote_file_path }} %}
{% 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)
else:
nc.logger.info("Current build version: %s" % running_slot_name_build_version)
{% if slapparameter_dict.get('sftp_remote_file_path') %}
download_rpc_xml = f"""
<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>
<remote-file-path>{{remote_file_path}}/{{firmware_name}}</remote-file-path>
</software-download>
"""
{% else %}
download_rpc_xml = f"""
<software-download xmlns="urn:o-ran:software-management:1.0">
<remote-file-path>{ remote_file_path }/{firmware_name}</remote-file-path>
</software-download>
"""
{% endif %}
download_reply_xml = nc.custom_rpc_request(download_rpc_xml)
if download_reply_xml:
download_data = xmltodict.parse(download_reply_xml)
......@@ -61,7 +43,7 @@ if __name__ == '__main__':
install_rpc_xml = f"""
<software-install xmlns="urn:o-ran:software-management:1.0">
<slot-name>{nonrunning_slot_name}</slot-name>
<file-names>{firmware_name}</file-names>
<file-names>{{firmware_name}}</file-names>
</software-install>
"""
install_reply_xml = nc.custom_rpc_request(install_rpc_xml)
......@@ -80,7 +62,7 @@ if __name__ == '__main__':
nc.software_reply_json_logger.info('', extra={'data': activate_data})
nc.get_inventory()
if nonrunning_slot_name_build_version in firmware_name and active_nonrunning_slot_name:
if nonrunning_slot_name_build_version in "{{firmware_name}}" and active_nonrunning_slot_name:
nc.logger.info("Active non-running slot has the updated build version. Resetting device.")
nc.reset_device()
break
......
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