Commit 72db605e authored by Joanne Hugé's avatar Joanne Hugé

WIP

parent fb39e73d
......@@ -27,15 +27,18 @@ class RunPromise(GenericPromise):
In this case, check whether the file exists.
"""
ifname = "{{ slap_configuration.get('tun-name', 'tun0') }}"
# f = open('/sys/class/net/%s/operstate' % ifname, 'r')
# if f.read() == 'up\n':
# self.logger.info("%s is up", ifname)
# else:
# self.logger.error("%s is down", ifname)
# f.close()
self.logger.info("OK")
ifname = "{{ slap_configuration.get('tun-name', '') }}"
if ifname:
f = open('/sys/class/net/%s/operstate' % ifname, 'r')
if f.read() == 'up\n':
self.logger.info("%s is up", ifname)
else:
self.logger.error("%s is down", ifname)
f.close()
self.logger.info("OK")
else:
self.logger.info("OK")
def test(self):
"""
......
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