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
Lu Xu
slapos
Commits
e7d5eee3
Commit
e7d5eee3
authored
May 29, 2024
by
Lu Xu
👀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wip
parent
ed36fafb
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
21 deletions
+24
-21
software/ors-amarisoft/buildout.hash.cfg
software/ors-amarisoft/buildout.hash.cfg
+3
-3
software/ors-amarisoft/ru/lopcomm/delay.jinja2.py
software/ors-amarisoft/ru/lopcomm/delay.jinja2.py
+2
-13
software/ors-amarisoft/ru/lopcomm/libinstance.jinja2.cfg
software/ors-amarisoft/ru/lopcomm/libinstance.jinja2.cfg
+3
-5
software/ors-amarisoft/ru/lopcomm/ncclient_common.py
software/ors-amarisoft/ru/lopcomm/ncclient_common.py
+16
-0
No files found.
software/ors-amarisoft/buildout.hash.cfg
View file @
e7d5eee3
...
...
@@ -44,7 +44,7 @@ md5sum = b7906ca3a6b17963f78f680fc0842b74
[ru_lopcomm_libinstance.jinja2.cfg]
_update_hash_filename_ = ru/lopcomm/libinstance.jinja2.cfg
md5sum =
5aa994705fc5e130e4fb372e10d3cbde
md5sum =
fc671b78f3d8ee6d39a00d48fabf241a
[ru_sunwave_libinstance.jinja2.cfg]
_update_hash_filename_ = ru/sunwave/libinstance.jinja2.cfg
...
...
@@ -52,11 +52,11 @@ md5sum = bc5d82b8737b6990674b280ef2774be7
[ru_lopcomm_ncclient_common.py]
_update_hash_filename_ = ru/lopcomm/ncclient_common.py
md5sum =
5cc878f4c596335a1b6d90e1c03b53a5
md5sum =
c0c0e2eccff46893f5595df8ea8d7fe8
[ru_lopcomm_delay.jinja2.py]
_update_hash_filename_ = ru/lopcomm/delay.jinja2.py
md5sum =
357847ea3aabbf08156466d113521cb
e
md5sum =
aa1cace87c12e5e225168cd1a962895
e
[ru_lopcomm_stats.jinja2.py]
_update_hash_filename_ = ru/lopcomm/stats.jinja2.py
...
...
software/ors-amarisoft/ru/lopcomm/delay.jinja2.py
View file @
e7d5eee3
...
...
@@ -16,20 +16,9 @@ if __name__ == '__main__':
while
True
:
try
:
nc
.
connect
(
"{{ netaddr.IPAddress(vtap.gateway) }}"
,
830
,
"oranuser"
,
"oranpassword"
)
nc
.
delay_management
()
nc
.
logger
.
info
(
"Processing with delay parameters..."
)
delay_rpc_xml
=
f"""
<get xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<filter type="xpath" xmlns:o-ran-delay-ru-cpri="urn:o-ran:delay-ru-cpri:1.0" select="/o-ran-delay-ru-cpri:ru-delay-profile" />
</get>
"""
delay_reply_xml
=
nc
.
custom_rpc_request
(
delay_rpc_xml
)
nc
.
logger
.
info
(
"Getting delay parameters..."
)
time
.
sleep
(
60
)
if
delay_reply_xml
:
nc
.
logger
.
info
(
"Got delay parameter."
)
delay_data
=
xmltodict
.
parse
(
delay_reply_xml
)
nc
.
delay_reply_json_logger
.
info
(
''
,
extra
=
{
'data'
:
json
.
dumps
(
delay_data
)})
break
except
Exception
as
e
:
nc
.
logger
.
debug
(
'Got exception, waiting 10 seconds before reconnecting...'
)
nc
.
logger
.
debug
(
str
(
e
))
...
...
software/ors-amarisoft/ru/lopcomm/libinstance.jinja2.cfg
View file @
e7d5eee3
...
...
@@ -26,16 +26,14 @@ recipe = slapos.recipe.template:jinja2
extensions = jinja2.ext.do
_logbase = ${directory:var}/log/{{B('%s-delay' % ru_ref)}}
log-output = ${:_logbase}.log
delay-reply-json-log-output = ${:_logbase}-reply
.json.log
json-log-output = ${:_logbase}
.json.log
context =
section directory directory
section vtap vtap.{{ ru.cpri_link._tap }}
key slapparameter_dict myslap:parameter_dict
key log_file :log-output
key delay_reply_json_log_file :delay-reply-json-log-output
key json_log_file :json-log-output
raw stats_period {{ slapparameter_dict.get("enb_stats_fetch_period", 60) }}
raw testing {{ testing }}
raw python_path {{ buildout_directory}}/bin/pythonwitheggs
raw buildout_directory_path {{ buildout_directory }}
import netaddr netaddr
mode = 0775
url = {{ ru_lopcomm_delay_template }}
...
...
software/ors-amarisoft/ru/lopcomm/ncclient_common.py
View file @
e7d5eee3
...
...
@@ -226,6 +226,22 @@ class LopcommNetconfClient:
self
.
supervision_reply_json_logger
.
info
(
''
,
extra
=
{
'data'
:
json
.
dumps
(
supervision_watchdog_data
)})
return
replied
def
delay_management
(
self
):
self
.
logger
.
info
(
'Getting delay parameters...'
)
delay_rpc_xml
=
"""
<get xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<filter type="xpath" xmlns:o-ran-delay-ru-cpri="urn:o-ran:delay-ru-cpri:1.0" select="/o-ran-delay-ru-cpri:ru-delay-profile" />
</get>
"""
delay_reply_xml
=
self
.
custom_rpc_request
(
delay_rpc_xml
)
if
delay_reply_xml
:
nc
.
logger
.
info
(
"Got delay parameter."
)
delay_data
=
xmltodict
.
parse
(
delay_reply_xml
)
if
self
.
delay_reply_json_logger
:
self
.
delay_reply_json_logger
.
info
(
''
,
extra
=
{
'data'
:
json
.
dumps
(
delay_data
)})
time
.
sleep
(
60
)
def
close
(
self
):
# Close not compatible between ncclient and netconf server
#self.conn.close()
...
...
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