From 9defd9d20802fc266f29a935e1a4cce1809e505b Mon Sep 17 00:00:00 2001 From: Alastair Flynn Date: Fri, 20 Sep 2024 17:23:34 +0100 Subject: [PATCH] fix: move parse_storage_constraints to the bunlde deployer It seems a previous change for allow bundle storage constraints was done at the wrong level and affected regualr storage constraints as well. This fix moves the previous change to only affect bunlde storage constraints. --- juju/bundle.py | 3 ++- juju/model.py | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/juju/bundle.py b/juju/bundle.py index 12239c881..80748ec9c 100644 --- a/juju/bundle.py +++ b/juju/bundle.py @@ -16,6 +16,7 @@ from .client import client from .constraints import parse as parse_constraints +from .constraints import parse_storage_constraint from .errors import JujuError from . import utils, jasyncio from .origin import Channel, Source @@ -630,7 +631,7 @@ async def run(self, context): constraints=self.constraints, endpoint_bindings=self.endpoint_bindings, resources=resources, - storage=self.storage, + storage={k: parse_storage_constraint(v) for k, v in (self.storage or dict()).items()}, channel=self.channel, devices=self.devices, num_units=self.num_units, diff --git a/juju/model.py b/juju/model.py index a51944de3..ad92ba0c3 100644 --- a/juju/model.py +++ b/juju/model.py @@ -29,7 +29,6 @@ from .client import client, connector from .client.overrides import Caveat, Macaroon from .constraints import parse as parse_constraints -from .constraints import parse_storage_constraint from .controller import Controller, ConnectedController from .delta import get_entity_class, get_entity_delta from .errors import JujuAPIError, JujuError, JujuModelConfigError, JujuBackupError @@ -2116,7 +2115,7 @@ async def _deploy(self, charm_url, application, series, config, devices=devices, dryrun=False, placement=placement, - storage={k: parse_storage_constraint(v) for k, v in (storage or dict()).items()}, + storage=storage, trust=trust, base=charm_origin.base, channel=channel, @@ -2151,7 +2150,7 @@ async def _deploy(self, charm_url, application, series, config, endpoint_bindings=endpoint_bindings, num_units=num_units, resources=resources, - storage={k: parse_storage_constraint(v) for k, v in (storage or dict()).items()}, + storage=storage, placement=placement, devices=devices, attach_storage=attach_storage,