Skip to content

Commit

Permalink
fix: move parse_storage_constraints to the bunlde deployer
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Aflynn50 committed Sep 20, 2024
1 parent 7d2107f commit 9defd9d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 2 additions & 1 deletion juju/bundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
5 changes: 2 additions & 3 deletions juju/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 9defd9d

Please sign in to comment.