Update changelog for 0.4.0
[osm/N2VC.git] / examples / add_machine.py
index c5f9a6c..8ae2d40 100755 (executable)
@@ -54,15 +54,17 @@ async def main():
                         for unit in application.units))
 
         await application.remove()
-        await machine3.destroy()
-        await machine2.destroy()
-        await machine1.destroy()
+
+        await machine3.destroy(force=True)
+        await machine2.destroy(force=True)
+        await machine1.destroy(force=True)
     finally:
         await model.disconnect()
 
 
-logging.basicConfig(level=logging.DEBUG)
-ws_logger = logging.getLogger('websockets.protocol')
-ws_logger.setLevel(logging.INFO)
+if __name__ == '__main__':
+    logging.basicConfig(level=logging.DEBUG)
+    ws_logger = logging.getLogger('websockets.protocol')
+    ws_logger.setLevel(logging.INFO)
 
-loop.run(main())
+    loop.run(main())