updates to check_cmd to just return output, as status is pointless

This commit is contained in:
Blake J. Harnden 2018-03-02 13:57:50 -08:00
parent 43554cbb62
commit a8ee7f35d6
12 changed files with 45 additions and 51 deletions

View file

@ -26,20 +26,19 @@ def emane_version():
VERSION = EMANEUNK
try:
status, output = utils.check_cmd(args)
if status == 0:
if output.startswith("0.7.4"):
VERSION = EMANE074
elif output.startswith("0.8.1"):
VERSION = EMANE081
elif output.startswith("0.9.1"):
VERSION = EMANE091
elif output.startswith("0.9.2"):
VERSION = EMANE092
elif output.startswith("0.9.3"):
VERSION = EMANE093
elif output.startswith("1.0.1"):
VERSION = EMANE101
output = utils.check_cmd(args)
if output.startswith("0.7.4"):
VERSION = EMANE074
elif output.startswith("0.8.1"):
VERSION = EMANE081
elif output.startswith("0.9.1"):
VERSION = EMANE091
elif output.startswith("0.9.2"):
VERSION = EMANE092
elif output.startswith("0.9.3"):
VERSION = EMANE093
elif output.startswith("1.0.1"):
VERSION = EMANE101
except subprocess.CalledProcessError:
logger.exception("error checking emane version")
output = ""

View file

@ -927,10 +927,9 @@ class EmaneManager(ConfigurableManager):
try:
args = emanecmd + ["-f", os.path.join(path, "emane%d.log" % n),
os.path.join(path, "platform%d.xml" % n)]
logger.info("Emane.startdaemons2() running %s" % str(args))
status, output = node.check_cmd(args)
logger.info("Emane.startdaemons2() return code %d" % status)
logger.info("Emane.startdaemons2() output: %s" % output)
logger.info("Emane.startdaemons2() running %s", args)
output = node.check_cmd(args)
logger.info("Emane.startdaemons2() output: %s", output)
except subprocess.CalledProcessError:
logger.exception("error starting emane")