Skip to content

Commit

Permalink
Merge branch 'main' into fix-make-test-target
Browse files Browse the repository at this point in the history
  • Loading branch information
cderici authored Jul 11, 2024
2 parents 0298fb5 + 4032529 commit f4f6ebc
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 7 deletions.
2 changes: 1 addition & 1 deletion juju/constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"zones",
"allocate_public_ip"]

LIST_KEYS = {'tags', 'spaces'}
LIST_KEYS = {'tags', 'spaces', 'zones'}

SNAKE1 = re.compile(r'(.)([A-Z][a-z]+)')
SNAKE2 = re.compile('([a-z0-9])([A-Z])')
Expand Down
10 changes: 5 additions & 5 deletions juju/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -2704,15 +2704,15 @@ async def update_secret(self, name, data_args=[], new_name="", file="", info="")
if result_error.error is not None:
raise JujuAPIError(result_error.error)

async def list_secrets(self, filter="", show_secrets=False):
async def list_secrets(self, filter=None, show_secrets=False):
"""
Returns the list of available secrets.
"""
facade = client.SecretsFacade.from_connection(self.connection())
results = await facade.ListSecrets({
'filter': filter,
'show-secrets': show_secrets,
})
results = await facade.ListSecrets(
filter_=filter,
show_secrets=show_secrets,
)
return results.results

async def remove_secret(self, secret_name, revision=-1):
Expand Down
2 changes: 2 additions & 0 deletions juju/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ def get_local_charm_charmcraft_yaml(path):
KINETIC = "kinetic"
LUNAR = "lunar"
MANTIC = "mantic"
NOBLE = "noble"

UBUNTU_SERIES = {
PRECISE: "12.04",
Expand All @@ -327,6 +328,7 @@ def get_local_charm_charmcraft_yaml(path):
KINETIC: "22.10",
LUNAR: "23.04",
MANTIC: "23.10",
NOBLE: "24.04",
}

KUBERNETES = "kubernetes"
Expand Down
4 changes: 4 additions & 0 deletions tests/integration/charm-manifest/manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,9 @@ bases:
- amd64
channel: '20.04'
name: ubuntu
- architectures:
- amd64
channel: '24.04'
name: ubuntu
charmcraft-started-at: '2021-08-20T08:09:00.639806Z'
charmcraft-version: 1.2.1
9 changes: 9 additions & 0 deletions tests/integration/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,15 @@ async def test_deploy_with_base():
await model.wait_for_idle(status='active')


@base.bootstrapped
async def test_deploy_noble():
charm_path = INTEGRATION_TEST_DIR / 'charm-manifest'

async with base.CleanModel() as model:
await model.deploy(str(charm_path), base="[email protected]")
await model.wait_for_idle(status='active')


@base.bootstrapped
async def test_add_machine():
from juju.machine import Machine
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def test_parse_constraints(self):
self.assertEqual(
_("mem=10G zones=bar,baz tags=tag1 spaces=space1,space2"),
{"mem": 10 * 1024,
"zones": "bar,baz",
"zones": ["bar", "baz"],
"tags": ["tag1"],
"spaces": ["space1", "space2"]}
)
Expand Down

0 comments on commit f4f6ebc

Please sign in to comment.