Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nirina Malard
slapos
Commits
8be1a636
Commit
8be1a636
authored
Aug 18, 2023
by
Lu Xu
👀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wip
parent
57f0fd9d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
18 deletions
+27
-18
software/ors-amarisoft/buildout.hash.cfg
software/ors-amarisoft/buildout.hash.cfg
+2
-2
software/ors-amarisoft/instance-enb.jinja2.cfg
software/ors-amarisoft/instance-enb.jinja2.cfg
+1
-0
software/ors-amarisoft/lopcomm-rrh-software.jinja2.py
software/ors-amarisoft/lopcomm-rrh-software.jinja2.py
+24
-16
No files found.
software/ors-amarisoft/buildout.hash.cfg
View file @
8be1a636
...
...
@@ -36,11 +36,11 @@ md5sum = b34fe47a73890097fbc6ea6374aeb38d
[lopcomm-rrh-software.jinja2.py]
_update_hash_filename_ = lopcomm-rrh-software.jinja2.py
md5sum = 4
b77deb2dc5687fa7294e19861913a74
md5sum = 4
8da4e30ea9f7ee3cbcc8734f19d00b2
[template-enb]
_update_hash_filename_ = instance-enb.jinja2.cfg
md5sum =
c45c582a72bf6a0666dc64e24c79774f
md5sum =
543e8f689cafae428c9af7e6b34e6936
[template-gnb]
_update_hash_filename_ = instance-gnb.jinja2.cfg
...
...
software/ors-amarisoft/instance-enb.jinja2.cfg
View file @
8be1a636
...
...
@@ -286,6 +286,7 @@ context =
raw testing {{ slapparameter_dict.get("testing", False) }}
raw python_path {{ buildout_directory}}/bin/pythonwitheggs
raw software_install_template {{ software_install_template }}
raw firmware_name lopcomm-firmware-dl:filename
import netaddr netaddr
mode = 0775
url = {{ lopcomm_rrh_software_template }}
...
...
software/ors-amarisoft/lopcomm-rrh-software.jinja2.py
View file @
8be1a636
...
...
@@ -91,27 +91,35 @@ if __name__ == '__main__':
inventory_data
=
xmltodict
.
parse
(
inventory_reply_xml
)
nc
.
software_output_json_logger
.
info
(
''
,
extra
=
{
'data'
:
inventory_data
})
# Find active software slot
active_slot_name
=
None
nonactive_slot_name
=
None
software_slots
=
inventory_data
[
'nc:rpc-reply'
][
'data'
][
'software-inventory'
][
'software-slot'
]
for
slot
in
software_slots
:
if
slot
[
'active'
]
==
'
false'
and
slot
[
'running'
]
==
'fals
e'
:
if
slot
[
'active'
]
==
'
true'
and
slot
[
'running'
]
==
'tru
e'
:
active_slot_name
=
slot
[
'name'
]
break
if
active_slot_name
:
# Install software in the active slot
install_rpc_xml
=
f"""
<software-install xmlns="urn:o-ran:software-management:1.0">
<slot-name>
{
active_slot_name
}
</slot-name>
<file-names>PR.PRM61C70V1002.K010927.tar.gz</file-names>
</software-install>
"""
install_reply_xml
=
nc
.
custom_rpc_request
(
install_rpc_xml
)
if
install_reply_xml
:
install_data
=
xmltodict
.
parse
(
install_reply_xml
)
nc
.
software_output_json_logger
.
info
(
''
,
extra
=
{
'data'
:
install_data
})
active_slot_build_version
=
slot
[
'build-version'
]
# Extract the build-version of the active slot
elif
slot
[
'active'
]
==
'false'
and
slot
[
'running'
]
==
'false'
:
nonactive_slot_name
=
slot
[
'name'
]
if
active_slot_name
and
nonactive_slot_name
:
# Check if the running slot's build-version is already in file-names of the active slot
if
active_slot_build_version
in
{{
firmware_name
}}:
nc
.
logger
.
info
(
"Running slot's build-version is already updated. Skipping install."
)
else
:
# Install software in the non-active slot
install_rpc_xml
=
f"""
<software-install xmlns="urn:o-ran:software-management:1.0">
<slot-name>
{
nonactive_slot_name
}
</slot-name>
<file-names>{{ firmware_name }}</file-names>
</software-install>
"""
install_reply_xml
=
nc
.
custom_rpc_request
(
install_rpc_xml
)
if
install_reply_xml
:
install_data
=
xmltodict
.
parse
(
install_reply_xml
)
nc
.
software_output_json_logger
.
info
(
''
,
extra
=
{
'data'
:
install_data
})
break
except
Exception
as
e
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment