Exit cleanly on Mininet errors.

Refs #4540

Change-Id: I7605c9740eca785e290e64e0d8a29339c92c7df2
This commit is contained in:
Alexander Lane
2018-05-14 11:37:43 -05:00
parent 532302bbf2
commit e842cc204d
+11 -1
View File
@@ -508,4 +508,14 @@ if __name__ == '__main__':
options = parse_args()
setLogLevel('info')
execute(options)
# No exceptions are raised in ndn presently, and Mininet relies
# on generic Exception. If this situation changes this may well
# need to be altered.
try:
execute(options)
except Exception as e:
print("Mininet Error: {}".format(e))
call(["nfd-stop"])
call(["sudo", "mn", "--clean"])
sys.exit(1)