initial effort to remove swallowing exceptions within internal code
This commit is contained in:
parent
a3356127d2
commit
43554cbb62
10 changed files with 423 additions and 399 deletions
|
@ -21,31 +21,30 @@ def emane_version():
|
|||
"""
|
||||
global VERSION
|
||||
global VERSIONSTR
|
||||
args = ("emane", "--version")
|
||||
|
||||
try:
|
||||
status, result = utils.check_cmd(args)
|
||||
except subprocess.CalledProcessError:
|
||||
logger.exception("error checking emane version")
|
||||
status = -1
|
||||
result = ""
|
||||
args = ["emane", "--version"]
|
||||
|
||||
VERSION = EMANEUNK
|
||||
if status == 0:
|
||||
if result.startswith("0.7.4"):
|
||||
VERSION = EMANE074
|
||||
elif result.startswith("0.8.1"):
|
||||
VERSION = EMANE081
|
||||
elif result.startswith("0.9.1"):
|
||||
VERSION = EMANE091
|
||||
elif result.startswith("0.9.2"):
|
||||
VERSION = EMANE092
|
||||
elif result.startswith("0.9.3"):
|
||||
VERSION = EMANE093
|
||||
elif result.startswith("1.0.1"):
|
||||
VERSION = EMANE101
|
||||
|
||||
VERSIONSTR = result.strip()
|
||||
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
|
||||
except subprocess.CalledProcessError:
|
||||
logger.exception("error checking emane version")
|
||||
output = ""
|
||||
|
||||
VERSIONSTR = output.strip()
|
||||
|
||||
|
||||
# set version variables for the Emane class
|
||||
|
|
|
@ -925,7 +925,8 @@ class EmaneManager(ConfigurableManager):
|
|||
logger.exception("error adding route for event data")
|
||||
|
||||
try:
|
||||
args = emanecmd + ["-f", os.path.join(path, "emane%d.log" % n), os.path.join(path, "platform%d.xml" % n)]
|
||||
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)
|
||||
|
@ -1163,14 +1164,15 @@ class EmaneManager(ConfigurableManager):
|
|||
Return True if an EMANE process associated with the given node
|
||||
is running, False otherwise.
|
||||
"""
|
||||
status = -1
|
||||
args = ["pkill", "-0", "-x", "emane"]
|
||||
|
||||
status = -1
|
||||
try:
|
||||
if emane.VERSION < emane.EMANE092:
|
||||
status = utils.check_cmd(args)
|
||||
utils.check_cmd(args)
|
||||
else:
|
||||
status, _ = node.check_cmd(args)
|
||||
node.check_cmd(args)
|
||||
status = 0
|
||||
except subprocess.CalledProcessError:
|
||||
logger.exception("error checking if emane is running")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue