Skip to content

Commit 5b55b35

Browse files
juanmanuel-tiradojujubotcderici
authored
[JUJU-3552] Prepare 3.1.2.1 release (#836)
* Add juju 3.1.2 missing facades. * Fix secrets-bakend-lifecycle test. * Increase testing timeouts. * Revisit postgresql charm to be downloaded. --------- Co-authored-by: Juju bot <jujubot@users.noreply.github.com> Co-authored-by: Caner Derici <caner.derici@canonical.com>
1 parent 96b8b07 commit 5b55b35

27 files changed

Lines changed: 303 additions & 53118 deletions

.github/workflows/test.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ jobs:
99
strategy:
1010
matrix:
1111
python:
12-
- "3.8"
1312
- "3.9"
1413
- "3.10"
1514
steps:
@@ -31,7 +30,6 @@ jobs:
3130
strategy:
3231
matrix:
3332
python:
34-
- "3.8"
3533
- "3.9"
3634
- "3.10"
3735
steps:
@@ -56,7 +54,6 @@ jobs:
5654
python:
5755
# We will reduce the workload to 3.10 to
5856
# save some resources for now.
59-
# - "3.8"
6057
# - "3.9"
6158
- "3.10"
6259
steps:

docs/readme.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ Documentation: https://pythonlibjuju.readthedocs.io/en/latest/
1111
Requirements
1212
------------
1313

14-
* Python 3.8/3.9/3.10
15-
* Tested using Juju 3.1.1
14+
* Python 3.9/3.10
1615

1716

1817
Design Notes

examples/add_secrets_backend.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ async def main():
1010
"""
1111

1212
m = Model()
13-
await m.connect_current()
13+
await m.connect()
1414

1515
# # deploy postgresql
16-
# await m.deploy('postgresql', series="focal")
16+
await m.deploy('postgresql', series="focal")
1717
# # deploy vault
1818
await m.deploy("vault", series="focal")
1919
# # relate/integrate
2020
await m.integrate("vault:db", "postgresql:db")
2121
# # wait for the
22-
await m.wait_for_idle(["vault"])
22+
await m.wait_for_idle(["postgresql", "vault"])
2323
# # expose vault
2424
vault_app = m.applications["vault"]
2525
await vault_app.expose()
@@ -38,16 +38,16 @@ async def main():
3838
keys = vault_client.sys.initialize(3, 2)
3939
print(keys)
4040

41-
target_unit = m.applications['vault'].units[0]
42-
action = await target_unit.run_action("authorize-charm", token=keys['token'])
43-
await action.wait()
44-
4541
# Unseal vault
4642
vault_client.sys.submit_unseal_keys(keys["keys"])
4743

44+
target_unit = m.applications['vault'].units[0]
45+
action = await target_unit.run_action("authorize-charm", token=keys["root_token"])
46+
await action.wait()
47+
4848
# Add the secret backend
4949
c = await m.get_controller()
50-
response = await c.add_secret_backends("1000", "myvault", "vault", {"endpoint": vault_url})
50+
response = await c.add_secret_backends("1111", "examplevault", "vault", {"endpoint": vault_url, "token": keys["root_token"]})
5151
print("Output from add secret backends")
5252
print(response["results"])
5353

@@ -57,9 +57,9 @@ async def main():
5757
print(list["results"])
5858

5959
# Remove it
60-
await c.remove_secret_backends("myvault")
60+
await c.remove_secret_backends("examplevault")
6161

62-
# Finally after removing
62+
# # Finally after removing
6363
list = await c.list_secret_backends()
6464
print("Output from list secret backends after removal")
6565
print(list["results"])

juju/bundle.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -350,14 +350,11 @@ async def _resolve_charms(self):
350350
continue
351351

352352
charm_url = URL.parse(spec['charm'])
353-
channel = None
354-
base = None
355-
track, risk = '', ''
356-
if 'channel' in spec:
357-
channel = Channel.parse(spec['channel'])
358-
track, risk = channel.track, channel.risk
359-
series = spec.get('series', None)
360-
base = get_base_from_origin_or_channel(channel, series)
353+
354+
channel = Channel.parse(spec['channel']) if 'channel' in spec else Channel('latest', 'stable')
355+
track, risk = channel.track, channel.risk
356+
series = spec.get('series', self.bundle.get('series', None))
357+
base = get_base_from_origin_or_channel(channel, series)
361358

362359
if self.charms_facade is not None:
363360
if cons is not None and cons['arch'] != '':

juju/client/_client.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -481,10 +481,6 @@ class SecretsManagerFacade(TypeFactory):
481481
pass
482482

483483

484-
class SecretsRevisionWatcherFacade(TypeFactory):
485-
pass
486-
487-
488484
class SecretsTriggerWatcherFacade(TypeFactory):
489485
pass
490486

juju/client/_client1.py

Lines changed: 0 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,7 +1080,6 @@ class CAASApplicationProvisionerFacade(Type):
10801080
'container': {'type': 'string'},
10811081
'cores': {'type': 'integer'},
10821082
'cpu-power': {'type': 'integer'},
1083-
'image-id': {'type': 'string'},
10841083
'instance-role': {'type': 'string'},
10851084
'instance-type': {'type': 'string'},
10861085
'mem': {'type': 'integer'},
@@ -10777,101 +10776,6 @@ async def WatchSecretsRotationChanges(self, entities=None):
1077710776

1077810777

1077910778

10780-
class SecretsRevisionWatcherFacade(Type):
10781-
name = 'SecretsRevisionWatcher'
10782-
version = 1
10783-
schema = {'definitions': {'Error': {'additionalProperties': False,
10784-
'properties': {'code': {'type': 'string'},
10785-
'info': {'patternProperties': {'.*': {'additionalProperties': True,
10786-
'type': 'object'}},
10787-
'type': 'object'},
10788-
'message': {'type': 'string'}},
10789-
'required': ['message', 'code'],
10790-
'type': 'object'},
10791-
'SecretRevisionChange': {'additionalProperties': False,
10792-
'properties': {'revision': {'type': 'integer'},
10793-
'uri': {'type': 'string'}},
10794-
'required': ['uri', 'revision'],
10795-
'type': 'object'},
10796-
'SecretRevisionWatchResult': {'additionalProperties': False,
10797-
'properties': {'changes': {'items': {'$ref': '#/definitions/SecretRevisionChange'},
10798-
'type': 'array'},
10799-
'error': {'$ref': '#/definitions/Error'},
10800-
'watcher-id': {'type': 'string'}},
10801-
'required': ['watcher-id',
10802-
'changes'],
10803-
'type': 'object'}},
10804-
'properties': {'Next': {'description': 'Next returns when a change has '
10805-
'occurred to an entity of the\n'
10806-
'collection being watched since the '
10807-
'most recent call to Next\n'
10808-
'or the Watch call that created the '
10809-
'srvSecretRotationWatcher.',
10810-
'properties': {'Result': {'$ref': '#/definitions/SecretRevisionWatchResult'}},
10811-
'type': 'object'},
10812-
'Stop': {'description': 'Stop stops the watcher.',
10813-
'type': 'object'}},
10814-
'type': 'object'}
10815-
10816-
10817-
@ReturnMapping(SecretRevisionWatchResult)
10818-
async def Next(self):
10819-
'''
10820-
Next returns when a change has occurred to an entity of the
10821-
collection being watched since the most recent call to Next
10822-
or the Watch call that created the srvSecretRotationWatcher.
10823-
10824-
10825-
Returns -> SecretRevisionWatchResult
10826-
'''
10827-
10828-
# map input types to rpc msg
10829-
_params = dict()
10830-
msg = dict(type='SecretsRevisionWatcher',
10831-
request='Next',
10832-
version=1,
10833-
params=_params)
10834-
10835-
reply = await self.rpc(msg)
10836-
return reply
10837-
10838-
10839-
10840-
@ReturnMapping(None)
10841-
async def Stop(self):
10842-
'''
10843-
Stop stops the watcher.
10844-
10845-
10846-
Returns -> None
10847-
'''
10848-
10849-
# map input types to rpc msg
10850-
_params = dict()
10851-
msg = dict(type='SecretsRevisionWatcher',
10852-
request='Stop',
10853-
version=1,
10854-
params=_params)
10855-
10856-
reply = await self.rpc(msg)
10857-
return reply
10858-
10859-
10860-
10861-
async def rpc(self, msg):
10862-
'''
10863-
Patch rpc method to add Id.
10864-
'''
10865-
if not hasattr(self, 'Id'):
10866-
raise RuntimeError('Missing "Id" field')
10867-
msg['Id'] = id
10868-
10869-
from .facade import TypeEncoder
10870-
reply = await self.connection.rpc(msg, encoder=TypeEncoder)
10871-
return reply
10872-
10873-
10874-
1087510779
class SecretsTriggerWatcherFacade(Type):
1087610780
name = 'SecretsTriggerWatcher'
1087710781
version = 1

juju/client/_client10.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,6 @@ class MachineManagerFacade(Type):
252252
'container': {'type': 'string'},
253253
'cores': {'type': 'integer'},
254254
'cpu-power': {'type': 'integer'},
255-
'image-id': {'type': 'string'},
256255
'instance-role': {'type': 'string'},
257256
'instance-type': {'type': 'string'},
258257
'mem': {'type': 'integer'},

juju/client/_client11.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1752,7 +1752,6 @@ class ProvisionerFacade(Type):
17521752
'container': {'type': 'string'},
17531753
'cores': {'type': 'integer'},
17541754
'cpu-power': {'type': 'integer'},
1755-
'image-id': {'type': 'string'},
17561755
'instance-role': {'type': 'string'},
17571756
'instance-type': {'type': 'string'},
17581757
'mem': {'type': 'integer'},

0 commit comments

Comments
 (0)