Skip to content

Commit

Permalink
Checkoutput
Browse files Browse the repository at this point in the history
  • Loading branch information
domschl committed Aug 17, 2023
1 parent ddb2dde commit 7d2d37f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions selftest/selftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,12 @@ def create_device(fhi, name, readings):
sys.exit(-2)

# os.system(config["exec"])
ret = subprocess.Popen(config["cmds"], cwd=config['fhem_dir'], close_fds=True)
log.info("Fhem startup at {}: {}".format(config['exec'], ret))
process = subprocess.Popen(config["cmds"], cwd=config['fhem_dir'],stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
output, error = process.communicate()
if process.returncode != 0:
raise Exception("Process fhem failed %d %s %s" % (process.returncode, output, error))
log.info("Fhem startup at {}: {}".format(config['exec'], output.decode('utf-8')))

retry_cnt = 10
for i in range(retry_cnt):
Expand Down

0 comments on commit 7d2d37f

Please sign in to comment.