4 1. Connects to the current model
5 2. Starts an AllWatcher
6 3. Prints all changes received from the AllWatcher
7 4. Runs forever (kill with Ctrl-C)
13 from juju
.client
.connection
import Connection
14 from juju
.client
import watcher
18 allwatcher
= watcher
.AllWatcher()
19 allwatcher
.connect(conn
)
21 change
= await allwatcher
.Next()
22 for delta
in change
.deltas
:
26 logging
.basicConfig(level
=logging
.DEBUG
)
27 loop
= asyncio
.get_event_loop()
28 conn
= loop
.run_until_complete(Connection
.connect_current())
29 loop
.run_until_complete(watch())