Skip to content

Commit 1bfbb4c

Browse files
Aflynn50james-garner-canonical
authored andcommitted
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.
1 parent 3911d1f commit 1bfbb4c

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

juju/bundle.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
from .client import client
1818
from .constraints import parse as parse_constraints
19+
from .constraints import parse_storage_constraint
1920
from .errors import JujuError
2021
from . import utils, jasyncio
2122
from .origin import Channel, Source
@@ -630,7 +631,7 @@ async def run(self, context):
630631
constraints=self.constraints,
631632
endpoint_bindings=self.endpoint_bindings,
632633
resources=resources,
633-
storage=self.storage,
634+
storage={k: parse_storage_constraint(v) for k, v in (self.storage or dict()).items()},
634635
channel=self.channel,
635636
devices=self.devices,
636637
num_units=self.num_units,

juju/model.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
from .client import client, connector
3030
from .client.overrides import Caveat, Macaroon
3131
from .constraints import parse as parse_constraints
32-
from .constraints import parse_storage_constraint
3332
from .controller import Controller, ConnectedController
3433
from .delta import get_entity_class, get_entity_delta
3534
from .errors import JujuAPIError, JujuError, JujuModelConfigError, JujuBackupError
@@ -2116,7 +2115,7 @@ async def _deploy(self, charm_url, application, series, config,
21162115
devices=devices,
21172116
dryrun=False,
21182117
placement=placement,
2119-
storage={k: parse_storage_constraint(v) for k, v in (storage or dict()).items()},
2118+
storage=storage,
21202119
trust=trust,
21212120
base=charm_origin.base,
21222121
channel=channel,
@@ -2151,7 +2150,7 @@ async def _deploy(self, charm_url, application, series, config,
21512150
endpoint_bindings=endpoint_bindings,
21522151
num_units=num_units,
21532152
resources=resources,
2154-
storage={k: parse_storage_constraint(v) for k, v in (storage or dict()).items()},
2153+
storage=storage,
21552154
placement=placement,
21562155
devices=devices,
21572156
attach_storage=attach_storage,

0 commit comments

Comments
 (0)