Skip to content

Commit 3186b78

Browse files
Merge pull request #687 from ittner/remove-deprecated-juju-loop-from-examples
Replace deprecated juju.loop() calls from examples and documentation
2 parents 6464bff + 7feb8d0 commit 3186b78

3 files changed

Lines changed: 5 additions & 6 deletions

File tree

docs/readme.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ ubuntu charm, then exits:
4949
import logging
5050
import sys
5151
52-
from juju import loop
52+
from juju import jasyncio
5353
from juju.model import Model
5454
5555
@@ -88,7 +88,7 @@ ubuntu charm, then exits:
8888
8989
# Run the deploy coroutine in an asyncio event loop, using a helper
9090
# that abstracts loop creation and teardown.
91-
loop.run(deploy())
91+
jasyncio.run(deploy())
9292
9393
9494
if __name__ == '__main__':

examples/deploy_bundle_charmhub.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
2. Deploy a bundle from charmhub and waits until it reports itself active
55
3. Destroys the unit and application
66
"""
7-
from juju import loop
7+
from juju import jasyncio
88
from juju.model import Model
99

1010

@@ -30,4 +30,4 @@ async def main():
3030

3131

3232
if __name__ == "__main__":
33-
loop.run(main())
33+
jasyncio.run(main())

examples/status.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
44
"""
55
from juju import jasyncio
6-
from juju import loop
76
import logging
87
import sys
98
from logging import getLogger
@@ -43,4 +42,4 @@ async def main():
4342
await model.disconnect()
4443

4544
if __name__ == '__main__':
46-
loop.run(main())
45+
jasyncio.run(main())

0 commit comments

Comments
 (0)