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

Add template for promise

parent 6aa0adb9
......@@ -40,7 +40,7 @@ md5sum = 7d25976008c3aa588527db2b461ad72c
[template-lte-mme]
_update_hash_filename_ = instance-mme.jinja2.cfg
md5sum = 6b2d5427d8cdea6ac49a305b41bf71c7
md5sum = eed24ef6943a1f3ab49329c8f8519e93
[ue_db.jinja2.cfg]
filename = config/ue_db.jinja2.cfg
......@@ -72,8 +72,8 @@ md5sum = 36281b03597252cf75169417d02fc28c
[sdr-busy-promise]
_update_hash_filename_ = promise/check_sdr_busy.py
md5sum = f7436ff76fea58e37a401d4712275422
md5sum = 2353f90918ea72df77c5823ed7cbaf77
[interface-up-promise]
_update_hash_filename_ = promise/check_interface_up.py
md5sum = 505efcbe04e717088924f2267b10c2b9
_update_hash_filename_ = promise/check_interface_up.jinja2.py
md5sum = f2618cb03b163a29c60d37de61a22269
......@@ -150,10 +150,17 @@ password = {{ slapparameter_dict['monitor-password'] | string }}
recipe = slapos.cookbook:publish.serialised
epc-ip = ${slap-configuration:ipv6-random}
[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 =
section slap_configuration slap-configuration
# Add custom promise to check if /dev/sdr0 is busy
[tun-up-promise]
recipe = slapos.cookbook:promise.plugin
eggs = slapos.core
file = {{ interface_up_promise }}
file = ${tun-up-promise-template:output}
output = ${directory:plugins}/check-tun-up.py
config-ifname = "slaptun0"
......@@ -27,7 +27,7 @@ class RunPromise(GenericPromise):
In this case, check whether the file exists.
"""
ifname = self.getConfig('ifname')
ifname = "{{ slap_configuration.get('tun-name', 'tun0') }}"
# f = open('/sys/class/net/%s/operstate' % ifname, 'r')
# if f.read() == 'up\n':
......
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