Commit 6aa0adb9 authored by Joanne Hugé's avatar Joanne Hugé

Empty promises

parent 73003c40
...@@ -29,12 +29,13 @@ class RunPromise(GenericPromise): ...@@ -29,12 +29,13 @@ class RunPromise(GenericPromise):
""" """
ifname = self.getConfig('ifname') ifname = self.getConfig('ifname')
f = open('/sys/class/net/%s/operstate' % ifname, 'r') # f = open('/sys/class/net/%s/operstate' % ifname, 'r')
if f.read() == 'up\n': # if f.read() == 'up\n':
self.logger.info("%s is up", ifname) # self.logger.info("%s is up", ifname)
else: # else:
self.logger.error("%s is down", ifname) # self.logger.error("%s is down", ifname)
f.close() # f.close()
self.logger.info("OK")
def test(self): def test(self):
""" """
......
...@@ -28,12 +28,13 @@ class RunPromise(GenericPromise): ...@@ -28,12 +28,13 @@ class RunPromise(GenericPromise):
In this case, check whether the file exists. In this case, check whether the file exists.
""" """
sdr_dev = '/dev/sdr0' sdr_dev = '/dev/sdr0'
try: # try:
open(sdr_dev, 'w').close() # open(sdr_dev, 'w').close()
self.logger.error("eNB is not using %s", sdr_dev) # self.logger.error("eNB is not using %s", sdr_dev)
except IOError as e: # except IOError as e:
if e.errno == errno.EBUSY: # if e.errno == errno.EBUSY:
self.logger.info("eNB is using %s", sdr_dev) # self.logger.info("eNB is using %s", sdr_dev)
self.logger.info("OK")
def test(self): 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