X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FN2VC.git;a=blobdiff_plain;f=examples%2Fadd_model.py;h=3e46490b20f6f45fcb89a173407c848467b03c74;hp=259771bfe8b98a38138fd3946e21b3504fbc2c4c;hb=7c2a530853c95b8a3518f6db0870f94858f87c27;hpb=adc6e51ff00d513cd68d4a046e87b25adf2021be diff --git a/examples/add_model.py b/examples/add_model.py index 259771b..3e46490 100644 --- a/examples/add_model.py +++ b/examples/add_model.py @@ -51,13 +51,14 @@ async def main(): print("Destroying model") await controller.destroy_model(model.info.uuid) - except Exception as e: + except Exception: LOG.exception( "Test failed! Model {} may not be cleaned up".format(model_name)) finally: print('Disconnecting from controller') - await model.disconnect() + if model: + await model.disconnect() await controller.disconnect()