Commit cff53075 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 32280eca
......@@ -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 %}
......
......@@ -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
......
......@@ -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 }}
......
......@@ -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"
......
......@@ -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:
......
......@@ -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()
......
......@@ -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()
......
......@@ -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">
......
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