X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=examples%2Fallwatcher.py;h=884230ba832ae731e798df22a4c46cf011e86721;hb=HEAD;hp=c78d689fe9d18588791bbfb8cf15b4f8e5617aa0;hpb=dcdf82bbc1ef310379f746518b2dd3b006353cb3;p=osm%2FN2VC.git diff --git a/examples/allwatcher.py b/examples/allwatcher.py deleted file mode 100644 index c78d689..0000000 --- a/examples/allwatcher.py +++ /dev/null @@ -1,31 +0,0 @@ -""" -This example: - -1. Connects to the current model -2. Starts an AllWatcher -3. Prints all changes received from the AllWatcher -4. Runs forever (kill with Ctrl-C) - -""" -import asyncio -import logging - -from juju.client.connection import Connection -from juju.client import client -from juju import loop - - -async def watch(): - conn = await Connection.connect_current() - allwatcher = client.AllWatcherFacade.from_connection(conn) - while True: - change = await allwatcher.Next() - for delta in change.deltas: - print(delta.deltas) - - -if __name__ == '__main__': - logging.basicConfig(level=logging.DEBUG) - # Run loop until the process is manually stopped (watch will loop - # forever). - loop.run(watch())