Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
slapos
Commits
cff53075
Commit
cff53075
authored
Oct 23, 2023
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
32280eca
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
43 additions
and
18 deletions
+43
-18
software/ors-amarisoft/ru/libinstance.jinja2.cfg
software/ors-amarisoft/ru/libinstance.jinja2.cfg
+34
-0
software/ors-amarisoft/ru/lopcomm/config.jinja2.py
software/ors-amarisoft/ru/lopcomm/config.jinja2.py
+1
-2
software/ors-amarisoft/ru/lopcomm/libinstance.jinja2.cfg
software/ors-amarisoft/ru/lopcomm/libinstance.jinja2.cfg
+3
-7
software/ors-amarisoft/ru/lopcomm/reset-info.jinja2.py
software/ors-amarisoft/ru/lopcomm/reset-info.jinja2.py
+1
-1
software/ors-amarisoft/ru/lopcomm/reset.jinja2.py
software/ors-amarisoft/ru/lopcomm/reset.jinja2.py
+1
-1
software/ors-amarisoft/ru/lopcomm/software.jinja2.py
software/ors-amarisoft/ru/lopcomm/software.jinja2.py
+1
-2
software/ors-amarisoft/ru/lopcomm/stats.jinja2.py
software/ors-amarisoft/ru/lopcomm/stats.jinja2.py
+1
-3
software/ors-amarisoft/ru/lopcomm/supervision.jinja2.py
software/ors-amarisoft/ru/lopcomm/supervision.jinja2.py
+1
-2
No files found.
software/ors-amarisoft/ru/libinstance.jinja2.cfg
View file @
cff53075
...
...
@@ -52,6 +52,40 @@ config-testing = {{ slapparameter_dict.get("testing", False) }}
lopcomm=rudrv_lopcomm,
sunwave=rudrv_sunwave) %}
{#- split slapos tap interface for each RU that needs its own tap.
fallback to non-split approach for ntap <= 1 to avoid hard-dependecy on setcap/tapsplit #}
{%- set ntap = iru_dict|dictsort | selectattr('1._.cpri_link._tap') |length %}
[vtap]
recipe = plone.recipe.command
ntap = {{ ntap }}
command = {{ netcapdo }} {{ tapsplit }} slap_configuration['tap-name'] ${:ntap}
update-command = ${:command}
stop-on-error = true
{%- if ntap <= 1 %}
[vtap]
ntap = 0
stop-on-error = false
{%- if ntap == 1 %}
[vtap.{{ slap_configuration['tap-name'] }}]
netaddr = {{ slap_configuration['tap-ipv6-network'] }}
gateway = {{ slap_configuration['tap-ipv6-gateway'] }}
{%- endif %}
{%- else %}
{%- for i in range(1,ntap+1) %}
[vtap.{{ slap_configuration['tap-name'] }}-{{ i }}]
netaddr = ...
gateway = ...
{%- endfor %}
{%- endif %}
{#- go through all RUs and for each RU emit generic promises and invoke
RU-specific buildout handler #}
{%- for ru_ref, iru in iru_dict|dictsort %}
...
...
software/ors-amarisoft/ru/lopcomm/config.jinja2.py
View file @
cff53075
...
...
@@ -8,8 +8,7 @@ if __name__ == '__main__':
nc
=
LopcommNetconfClient
(
log_file
=
"{{ log_file }}"
)
while
True
:
try
:
# XXX ::1 temp - kill
nc
.
connect
(
"{{ netaddr.IPAddress(slap_configuration.get('XXXtap-ipv6-gateway', '::1')) }}"
,
830
,
"oranuser"
,
"oranpassword"
)
nc
.
connect
(
"{{ netaddr.IPAddress(vtap.gateway) }}"
,
830
,
"oranuser"
,
"oranpassword"
)
# XXX CreateProcessingEle should be also RU-specific ?
nc
.
edit_config
([
"{{ ru_lopcomm_CreateProcessingEle_template }}"
,
"{{ cu_config_template }}"
])
break
...
...
software/ors-amarisoft/ru/lopcomm/libinstance.jinja2.cfg
View file @
cff53075
...
...
@@ -29,7 +29,7 @@ supervision-reply-json-log-output = ${:_logbase}.json.log
is_netconf_connected = ${directory:etc}/{{ru_ref}}.is_netconf_connected
context =
section directory directory
section
slap_configuration slap-configuration
section
vtap vtap.{{ ru.cpri_link._tap }}
key slapparameter_dict slap-configuration:configuration
key log_file :log-output
key supervision_reply_json_log_file :supervision-reply-json-log-output
...
...
@@ -67,7 +67,7 @@ remote-file-path = sftp://${user-info:pw-name}@[${slap-configuration:ipv6-random
is_firmware_updated = ${directory:etc}/{{ru_ref}}.is_firmware_updated
context =
section directory directory
section
slap_configuration slap-configuration
section
vtap vtap.{{ ru.cpri_link._tap }}
key slapparameter_dict slap-configuration:configuration
key log_file :log-output
key software_reply_json_log_file :software-reply-json-log-output
...
...
@@ -117,8 +117,7 @@ extensions = jinja2.ext.do
log-output = ${directory:var}/log/{{ru_ref}}-config.log
context =
section directory directory
section slap_configuration slap-configuration
key slapparameter_dict slap-configuration:configuration
section vtap vtap.{{ ru.cpri_link._tap }}
key log_file :log-output
raw testing {{ slapparameter_dict.get("testing", False) }}
raw python_path {{ buildout_directory}}/bin/pythonwitheggs
...
...
@@ -149,7 +148,6 @@ ncsession-json-log-output = ${:_logbase}-ncsession.json.log
software-json-log-output = ${:_logbase}-software.json.log
context =
section directory directory
section slap_configuration slap-configuration
key slapparameter_dict slap-configuration:configuration
key log_file :log-output
key json_log_file :json-log-output
...
...
@@ -213,7 +211,6 @@ _logbase = ${directory:var}/log/{{ru_ref}}-reset-info
log-output = ${:_logbase}.log
json-log-output = ${:_logbase}.json.log
context =
section slap_configuration slap-configuration
key log_file :log-output
key json_log_file :json-log-output
raw testing {{ slapparameter_dict.get("testing", False) }}
...
...
@@ -230,7 +227,6 @@ _logbase = ${directory:var}/log/{{ru_ref}}-reset
log-output = ${:_logbase}.log
json-log-output = ${:_logbase}.json.log
context =
section slap_configuration slap-configuration
key log_file :log-output
raw python_path {{ buildout_directory}}/bin/pythonwitheggs
raw buildout_directory_path {{ buildout_directory }}
...
...
software/ors-amarisoft/ru/lopcomm/reset-info.jinja2.py
View file @
cff53075
...
...
@@ -19,7 +19,7 @@ def get_uptime(hostname, username, password):
client
.
close
()
# Usage
hostname
=
"{{ netaddr.IPAddress(
slap_configuration.get('tap-ipv6-gateway', '')
) }}"
hostname
=
"{{ netaddr.IPAddress(
vtap.gateway
) }}"
username
=
"oranuser"
password
=
"oranpassword"
...
...
software/ors-amarisoft/ru/lopcomm/reset.jinja2.py
View file @
cff53075
...
...
@@ -7,7 +7,7 @@ from ncclient_common import LopcommNetconfClient
if
__name__
==
'__main__'
:
nc
=
LopcommNetconfClient
(
log_file
=
"{{ log_file }}"
)
try
:
nc
.
connect
(
"{{ netaddr.IPAddress(
slap_configuration.get('tap-ipv6-gateway', '')
) }}"
,
830
,
"oranuser"
,
"oranpassword"
)
nc
.
connect
(
"{{ netaddr.IPAddress(
vtap.gateway
) }}"
,
830
,
"oranuser"
,
"oranpassword"
)
nc
.
reset_device
()
nc
.
logger
.
info
(
"Device reset successful."
)
except
Exception
as
e
:
...
...
software/ors-amarisoft/ru/lopcomm/software.jinja2.py
View file @
cff53075
...
...
@@ -16,8 +16,7 @@ if __name__ == '__main__':
while
True
:
try
:
firmware_check_file
=
'{{ is_firmware_updated }}'
# XXX ::1 temp - kill
nc
.
connect
(
"{{ netaddr.IPAddress(slap_configuration.get('XXXtap-ipv6-gateway', '::1')) }}"
,
830
,
"oranuser"
,
"oranpassword"
)
nc
.
connect
(
"{{ netaddr.IPAddress(vtap.gateway) }}"
,
830
,
"oranuser"
,
"oranpassword"
)
# Fetch software inventory
inventory_vars
=
nc
.
get_inventory
()
...
...
software/ors-amarisoft/ru/lopcomm/stats.jinja2.py
View file @
cff53075
...
...
@@ -15,9 +15,7 @@ if __name__ == '__main__':
)
while
True
:
try
:
# XXX temp -> reenable
#nc.connect("{ { netaddr.IPAddress(slap_configuration.get('tap-ipv6-gateway', '')) } }", 830, "oranuser", "oranpassword")
nc
.
connect
(
"{{ netaddr.IPAddress('::1') }}"
,
830
,
"oranuser"
,
"oranpassword"
)
nc
.
connect
(
"{{ netaddr.IPAddress(vtap.gateway) }}"
,
830
,
"oranuser"
,
"oranpassword"
)
nc
.
subscribe
()
while
True
:
nc
.
get_notification
()
...
...
software/ors-amarisoft/ru/lopcomm/supervision.jinja2.py
View file @
cff53075
...
...
@@ -15,8 +15,7 @@ if __name__ == '__main__':
)
try
:
netconf_check_file
=
'{{ is_netconf_connected }}'
# XXX ::1 temp - kill
nc
.
connect
(
"{{ netaddr.IPAddress(slap_configuration.get('XXXtap-ipv6-gateway', '::1')) }}"
,
830
,
"oranuser"
,
"oranpassword"
)
nc
.
connect
(
"{{ netaddr.IPAddress(vtap.gateway) }}"
,
830
,
"oranuser"
,
"oranpassword"
)
supervision_subscription_rpc_xml
=
"""
<create-subscription xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
...
...
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