Skip to content

Commit c4c302e

Browse files
authored
Merge pull request #713 from juju/merge_2.9.11
#713 Update the 2.9 branch with the latest changes on version 2.9.11.
2 parents 6320078 + ff4c5da commit c4c302e

151 files changed

Lines changed: 221526 additions & 3813 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/tox.yaml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,13 @@ jobs:
88
runs-on: ubuntu-latest
99
strategy:
1010
matrix:
11-
python: [3.5, 3.6, 3.7, 3.8, 3.9]
11+
python:
12+
- "3.5"
13+
- "3.6"
14+
- "3.7"
15+
- "3.8"
16+
- "3.9"
17+
- "3.10"
1218
steps:
1319
- name: Check out code
1420
uses: actions/checkout@v2
@@ -25,11 +31,17 @@ jobs:
2531
runs-on: ubuntu-latest
2632
strategy:
2733
matrix:
28-
python: [3.5, 3.6, 3.7, 3.8, 3.9]
34+
python:
35+
- "3.5"
36+
- "3.6"
37+
- "3.7"
38+
- "3.8"
39+
- "3.9"
40+
- "3.10"
2941
steps:
3042
- uses: actions/checkout@v2
3143
- name: Setup Python
32-
uses: actions/setup-python@v1
44+
uses: actions/setup-python@v2
3345
with:
3446
python-version: ${{ matrix.python }}
3547
- name: Install dependencies

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ clean:
1616

1717
.PHONY: client
1818
client:
19-
tox -r --notest -e lint,py38
19+
tox -r --notest -e lint,py3
2020
$(PY) -m juju.client.facade -s "juju/client/schemas*" -o juju/client/
2121

2222
.PHONY: test
@@ -27,7 +27,7 @@ test: lint
2727

2828
.PHONY: lint
2929
lint:
30-
tox -e lint --notest
30+
tox -e lint
3131

3232
.PHONY: docs
3333
docs: .tox

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.9.3
1+
2.9.11

docs/changelog.rst

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,136 @@
11
Changelog
22
---------
33

4+
2.9.11
5+
^^^^^^
6+
7+
Monday July 11 2022
8+
9+
## What's Changed
10+
11+
* Add REPL quickstart subsection by @sed-i in https://github.com/juju/python-libjuju/pull/676
12+
* Revision of test onos.charm by @juanmanuel-tirado in https://github.com/juju/python-libjuju/pull/686
13+
* [JUJU-1353] Parse assume directives. by @juanmanuel-tirado in https://github.com/juju/python-libjuju/pull/685
14+
* Replace deprecated juju.loop() calls from examples and documentation by @ittner in https://github.com/juju/python-libjuju/pull/687
15+
* Fixed the bundle run when the channel is None by @oEscal in https://github.com/juju/python-libjuju/pull/664
16+
17+
2.9.10
18+
^^^^^^
19+
20+
Thursday June 9 2022
21+
22+
* [JUJU-1155] Avoid incorrectly setting `series: kubernetes` for sidecar charms in k8s bundles by @cderici in https://github.com/juju/python-libjuju/pull/679
23+
* [JUJU-1172] Visiting the pylibjuju CI by @cderici in https://github.com/juju/python-libjuju/pull/681
24+
* [JUJU-1124] Avoid sending path across the wire for local resource file name by @cderici in https://github.com/juju/python-libjuju/pull/678
25+
26+
2.9.9
27+
^^^^^
28+
29+
Wednesday April 26 2022
30+
31+
* [JUJU-835] Avoid ignoring asyncio exceptions in coroutines by @cderici in https://github.com/juju/python-libjuju/pull/658
32+
* [JUJU-843] Attach-resource to check if given binary file by @cderici in https://github.com/juju/python-libjuju/pull/659
33+
* [JUJU-858] Add quality of life feature ensure application removal at return by @cderici in https://github.com/juju/python-libjuju/pull/665
34+
* [JUJU-965] Add a bit of client side constraint validation by @cderici in https://github.com/juju/python-libjuju/pull/666
35+
* support python3.10 with later versions of websockets by @addyess in https://github.com/juju/python-libjuju/pull/673
36+
* Revert "Avoid ignoring asyncio exceptions in coroutines" by @simskij in https://github.com/juju/python-libjuju/pull/672
37+
* [JUJU-796] Add relate method and deprecate add-relation by @jack-w-shaw in https://github.com/juju/python-libjuju/pull/660
38+
* [JUJU-981] Get series from deployed app instead of metadata when charm upgrade by @cderici in https://github.com/juju/python-libjuju/pull/671
39+
40+
2.9.8
41+
^^^^^
42+
43+
Monday March 21 2022
44+
45+
* [JUJU-567] Use ModelManager instead of ControllerFacade to list available models by @cderici in https://github.com/juju/python-libjuju/pull/632
46+
* [JUJU-573] Fix charm resolution for Juju 2.8.11 by @cderici in https://github.com/juju/python-libjuju/pull/633
47+
* [JUJU-704] Remove non-implemented (stuıb) functions by @cderici in https://github.com/juju/python-libjuju/pull/646
48+
* [JUJU-676] Avoid defaulting to empty string for charm origin by @cderici in https://github.com/juju/python-libjuju/pull/647
49+
* Charmstore compatability of deploying bundles by @addyess in https://github.com/juju/python-libjuju/pull/650
50+
* [JUJU-731] Subordinate charm num unit by @cderici in https://github.com/juju/python-libjuju/pull/648
51+
* [JUJU-769] Facade schemas for 2.9.27 by @cderici in https://github.com/juju/python-libjuju/pull/652
52+
* [JUJU-771] Auto switch to scale from add_unit on container based models by @cderici in https://github.com/juju/python-libjuju/pull/653
53+
54+
2.9.7
55+
^^^^^
56+
57+
Friday February 11 2022
58+
59+
* [JUJU-556] Facade schemas for Juju 2.9.24 by @cderici in https://github.com/juju/python-libjuju/pull/626
60+
* Provide extra metadata with charmstore.entity(...) by @addyess in https://github.com/juju/python-libjuju/pull/635
61+
62+
2.9.6
63+
^^^^^
64+
65+
Thursday January 27 2022
66+
67+
* [JUJU-320] Unit public address by @SimonRichardson in https://github.com/juju/python-libjuju/pull/600
68+
* [JUJU-244] Add attach-resource by @cderici in https://github.com/juju/python-libjuju/pull/601
69+
* [JUJU-140] Model.wait_for_idle -- for apps with no units yet by @cderici in https://github.com/juju/python-libjuju/pull/575
70+
* [JUJU-367] Improve `get_charm_series` to check the model for series for a local charm by @cderici in https://github.com/juju/python-libjuju/pull/607
71+
* [JUJU-366] Utility for connecting directly to existing connection by @cderici in https://github.com/juju/python-libjuju/pull/605
72+
* Use public-address key instead of public_address by @wolsen in https://github.com/juju/python-libjuju/pull/610
73+
* [JUJU-376] `wait_for_idle` to support scale down by @cderici in https://github.com/juju/python-libjuju/pull/613
74+
* [JUJU-378] Utility for block_until-ing with a custom coroutine by @cderici in https://github.com/juju/python-libjuju/pull/614
75+
* Fallback to 'local-fan' by @dparv in https://github.com/juju/python-libjuju/pull/612
76+
* Minor comments on docs for block_until related functions. by @juanmanuel-tirado in https://github.com/juju/python-libjuju/pull/617
77+
* Additional checks in print status. by @juanmanuel-tirado in https://github.com/juju/python-libjuju/pull/622
78+
79+
2.9.5
80+
^^^^^
81+
82+
Friday December 3 2021
83+
84+
* remove the event loop arguments by @cderici in https://github.com/juju/python-libjuju/pull/560
85+
* add debug-log by @cderici in https://github.com/juju/python-libjuju/pull/562
86+
* Model status by @juanmanuel-tirado in https://github.com/juju/python-libjuju/pull/563
87+
* Pin cffi version to 1.14.6 for Python 3.5 by @cderici in https://github.com/juju/python-libjuju/pull/570
88+
* Wait for applications to terminate on model reset by @balbirthomas in https://github.com/juju/python-libjuju/pull/572
89+
* Babysitting python3.5 by @cderici in https://github.com/juju/python-libjuju/pull/571
90+
* Deploy charmhub bundles by @cderici in https://github.com/juju/python-libjuju/pull/569
91+
* Facade schemas for 2.9.17 by @SimonRichardson in https://github.com/juju/python-libjuju/pull/579
92+
* Bundles with overlays by @cderici in https://github.com/juju/python-libjuju/pull/566
93+
* Consistently getting a unit's public address by @cderici in https://github.com/juju/python-libjuju/pull/573
94+
* [JUJU-158] Add python3.9 to setup.py by @cderici in https://github.com/juju/python-libjuju/pull/585
95+
* [JUJU-157] Add note for removing services by @cderici in https://github.com/juju/python-libjuju/pull/583
96+
* Added boolean entries to normalize values. by @juanmanuel-tirado in https://github.com/juju/python-libjuju/pull/582
97+
* [JUJU-138] Streamlining asyncio tasks/events by @cderici in https://github.com/juju/python-libjuju/pull/580
98+
* [JUJU-234] Fix for small bug in task handling by @cderici in https://github.com/juju/python-libjuju/pull/589
99+
* Ensure all watchers validate for the Id by @SimonRichardson in https://github.com/juju/python-libjuju/pull/592
100+
* [JUJU-276] Facade schemas for 2.9.19 by @cderici in https://github.com/juju/python-libjuju/pull/594
101+
* [JUJU-238] Small bug fix for old ClientFacade support by @cderici in https://github.com/juju/python-libjuju/pull/593
102+
* [JUJU-239] Debug-log parameters by @cderici in https://github.com/juju/python-libjuju/pull/595
103+
* [JUJU-213] Local type `file` resource support by @cderici in https://github.com/juju/python-libjuju/pull/590
104+
* [JUJU-289] Use provided series in deploy if supported by @jack-w-shaw in https://github.com/juju/python-libjuju/pull/596
105+
* [JUJU-292] Update the charms in the tests to use Charmhub by @cderici in https://github.com/juju/python-libjuju/pull/597
106+
* Legacy "services" for describing "applications" within bundles are no longer supported. "applications" can be used as a direct replacement for "services" in bundles.yaml.
107+
* The websocket (ws) in a Connection object became a read-only property.
108+
109+
2.9.4
110+
^^^^^
111+
112+
Tuesday October 12 2021
113+
114+
* Charmhub deploy charm by @SimonRichardson in https://github.com/juju/python-libjuju/pull/483
115+
* add wait_for_status instead of wait_for_active by @sed-i in https://github.com/juju/python-libjuju/pull/517
116+
* Adds resource support for charmhub deployments by @tlm in https://github.com/juju/python-libjuju/pull/516
117+
* Fix bug #519 and #522: Add local resources for bundles by @davigar15 in https://github.com/juju/python-libjuju/pull/520
118+
* Patching some missing kwargs by @cderici in https://github.com/juju/python-libjuju/pull/527
119+
* Implementing `backup` functionality by @cderici in https://github.com/juju/python-libjuju/pull/536
120+
* Fix issue 532: Set the default_series properly by @davigar15 in https://github.com/juju/python-libjuju/pull/533
121+
* A random small bug fix by @cderici in https://github.com/juju/python-libjuju/pull/541
122+
* Allow ApplicationFacade set_config with non-string values by @cderici in https://github.com/juju/python-libjuju/pull/540
123+
* Skip macaroon tests issue 534 by @cderici in https://github.com/juju/python-libjuju/pull/542
124+
* Fix issue 530: Check the controller for unsynched models by @cderici in https://github.com/juju/python-libjuju/pull/539
125+
* Upgrade setup-python action. by @juanmanuel-tirado in https://github.com/juju/python-libjuju/pull/543
126+
* Fix integration tests by @cderici in https://github.com/juju/python-libjuju/pull/544
127+
* Bring juju/juju.py into life by @cderici in https://github.com/juju/python-libjuju/pull/546
128+
* Extract resources info from apps in locally deployed bundle by @cderici in https://github.com/juju/python-libjuju/pull/552
129+
* Fix for simple bug in bundle deployment code self.charm -> self['charm'] by @jnsgruk in https://github.com/juju/python-libjuju/pull/558
130+
* Fix integration tests continued by @cderici in https://github.com/juju/python-libjuju/pull/547
131+
* Get the config dir resolve logic into one place by @cderici in https://github.com/juju/python-libjuju/pull/555
132+
* Complete the backups functionality by @cderici in https://github.com/juju/python-libjuju/pull/556
133+
4134
2.9.3
5135
^^^^^
6136

docs/narrative/application.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ application. The `mysql_app` object is an instance of
9595
9696
Adding and Removing Relations
9797
-----------------------------
98-
The :meth:`juju.application.Application.add_relation` method returns a
98+
The :meth:`juju.application.Application.relate` method returns a
9999
:class:`juju.relation.Relation` instance.
100100

101101
.. code:: python
@@ -122,7 +122,7 @@ The :meth:`juju.application.Application.add_relation` method returns a
122122
)
123123
124124
# Add the master-slave relation
125-
relation = await mysql_master.add_relation(
125+
relation = await mysql_master.relate(
126126
# Name of the relation on the local (mysql-master) side
127127
'master',
128128
# Name of the app:relation on the remote side

docs/readme.rst

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ Installation
3636
3737
Quickstart
3838
----------
39+
3940
Here's a simple example that shows basic usage of the library. The example
4041
connects to the currently active Juju model, deploys a single unit of the
4142
ubuntu charm, then exits:
@@ -48,7 +49,7 @@ ubuntu charm, then exits:
4849
import logging
4950
import sys
5051
51-
from juju import loop
52+
from juju import jasyncio
5253
from juju.model import Model
5354
5455
@@ -87,7 +88,7 @@ ubuntu charm, then exits:
8788
8889
# Run the deploy coroutine in an asyncio event loop, using a helper
8990
# that abstracts loop creation and teardown.
90-
loop.run(deploy())
91+
jasyncio.run(deploy())
9192
9293
9394
if __name__ == '__main__':
@@ -103,6 +104,25 @@ example, to run ``examples/connect_current_model.py``, use:
103104
tox -e example -- examples/connect_current_model.py
104105
105106
107+
REPL
108+
^^^^
109+
110+
To experiment with the library in a REPL, launch python in asyncio mode
111+
112+
.. code:: bash
113+
114+
$ python3 -m asyncio
115+
116+
and then, to connect to the current model and fetch status:
117+
118+
.. code::
119+
120+
>>> from juju.model import Model
121+
>>> model = Model()
122+
>>> await model.connect_current()
123+
>>> status = await model.get_status()
124+
125+
106126
Versioning
107127
----------
108128

examples/action.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"""
1010
import logging
1111

12-
from juju import loop
12+
from juju import jasyncio
1313
from juju.model import Model
1414

1515

@@ -39,11 +39,12 @@ async def main():
3939
for unit in app.units:
4040
await run_action(unit)
4141

42+
await app.remove()
4243
await model.disconnect()
4344

4445

4546
if __name__ == '__main__':
4647
logging.basicConfig(level=logging.DEBUG)
4748
ws_logger = logging.getLogger('websockets.protocol')
4849
ws_logger.setLevel(logging.INFO)
49-
loop.run(main())
50+
jasyncio.run(main())

examples/add_k8s.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import yaml
1313
import base64
1414

15-
from juju import loop
15+
from juju import jasyncio
1616
from juju.client import client
1717
from juju.controller import Controller
1818

@@ -48,11 +48,12 @@ async def main():
4848
)
4949
await controller.add_credential("test", credential=cred, cloud="test")
5050

51+
await controller.remove_cloud('test')
5152
await controller.disconnect()
5253

5354

5455
if __name__ == '__main__':
5556
logging.basicConfig(level=logging.DEBUG)
5657
ws_logger = logging.getLogger('websockets.protocol')
5758
ws_logger.setLevel(logging.INFO)
58-
loop.run(main())
59+
jasyncio.run(main())

examples/add_machine.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"""
1111
import logging
1212

13-
from juju import loop
13+
from juju import jasyncio
1414
from juju.model import Model
1515

1616
MB = 1
@@ -69,4 +69,4 @@ async def main():
6969
ws_logger = logging.getLogger('websockets.protocol')
7070
ws_logger.setLevel(logging.INFO)
7171

72-
loop.run(main())
72+
jasyncio.run(main())

examples/add_model.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
3. Attempts to ssh into the charm
77
88
"""
9-
from juju import loop
9+
from juju import jasyncio
1010
from juju import utils
1111
from juju.controller import Controller
1212
import asyncio
@@ -64,4 +64,4 @@ async def main():
6464

6565

6666
if __name__ == '__main__':
67-
loop.run(main())
67+
jasyncio.run(main())

0 commit comments

Comments
 (0)