Commit 65426514 authored by Joanne Hugé's avatar Joanne Hugé

ors-amarisoft: fix check-tun-up promise

parent a97d44d1
......@@ -40,7 +40,7 @@ md5sum = 9732653a0e2c7fe91d80da80762430d2
[template-lte-mme]
_update_hash_filename_ = instance-mme.jinja2.cfg
md5sum = 19166c4a4ecf6b744aac36a068248d85
md5sum = 728f4d3ae248710c23e4b73eea4d628e
[ue_db.jinja2.cfg]
filename = config/ue_db.jinja2.cfg
......@@ -75,5 +75,5 @@ _update_hash_filename_ = promise/check_sdr_busy.jinja2.py
md5sum = 93dacb1da15310eb70d0815711a06cdf
[interface-up-promise]
_update_hash_filename_ = promise/check_interface_up.jinja2.py
md5sum = 63d3bbac7b6f480ee0c510e80aa1ccf7
_update_hash_filename_ = promise/check_interface_up.py
md5sum = cbe3ac5d123e38cc6adf168f39cc8189
......@@ -177,17 +177,15 @@ recipe = slapos.cookbook:publish.serialised
epc-ipv6 = ${slap-configuration:ipv6-random}
epc-ipv4 = {{ epc_ipv4 }}
[tun-up-promise-template]
recipe = slapos.recipe.template:jinja2
url = {{ interface_up_promise }}
output = ${directory:etc}/check-tun-up.py
extensions = jinja2.ext.do
context =
key slapparameter_dict slap-configuration:configuration
# Add custom promise to check if tun is up
# Add custom promise to check if /dev/sdr0 is busy
[tun-up-promise]
recipe = slapos.cookbook:promise.plugin
eggs = slapos.core
file = ${tun-up-promise-template:output}
file = {{ interface_up_promise }}
output = ${directory:plugins}/check-tun-up.py
{% if not slapparameter_dict.get("testing", False) %}
config-ifname = ${slap-configuration:tun-name}
{% else %}
config-ifname =
{% endif %}
config-testing = {{ slapparameter_dict.get("testing", False) }}
......@@ -27,8 +27,8 @@ class RunPromise(GenericPromise):
In this case, check whether the file exists.
"""
ifname = "{{ slapparameter_dict.get('tun-name', '') }}"
testing = {{ slapparameter_dict.get('testing', False) }}
ifname = self.getConfig('ifname')
testing = self.getConfig('testing')
if testing:
self.logger.info("skipping promise")
......
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