Description
When deploying a bundle with the zones constraint in a machine, the deployment fails with the following error from the juju API:
juju.errors.JujuAPIError: json: cannot unmarshal string into Go struct field Value.params.constraints.zones of type []string
The problem seems to be that python-libjuju sends the zones key as a string instead of an array of strings, as juju expects. See: https://github.com/juju/juju/blob/3.6/core/constraints/constraints.go#L107.
Urgency
Annoying bug in our test suite
Python-libjuju version
3.4
Juju version
3.4.2
Reproduce / Test
import asyncio
from juju.model import Model
bundle_file = "./bundle.yaml"
bundle = """
name: sample-bundle
series: jammy
machines:
"0":
constraints: zones=z-1
applications:
postgresql:
charm: postgresql
channel: 14/stable
num_units: 1
to:
- lxd:0
"""
async def main():
with open(bundle_file, "w") as f:
f.write(bundle)
model = Model()
await model.connect()
await model.deploy(bundle_file)
asyncio.run(main())
Description
When deploying a bundle with the
zonesconstraint in a machine, the deployment fails with the following error from the juju API:The problem seems to be that python-libjuju sends the
zoneskey as a string instead of an array of strings, as juju expects. See: https://github.com/juju/juju/blob/3.6/core/constraints/constraints.go#L107.Urgency
Annoying bug in our test suite
Python-libjuju version
3.4
Juju version
3.4.2
Reproduce / Test