Commit c033058
authored
Merge pull request #1054 from luissimas/fix-zone-constraints
#1054
#### Description
Closes #1050. This fixes the parsing of the `zones` constraint in bundles. The format in the Juju API is defined in: https://github.com/juju/juju/blob/3.6/core/constraints/constraints.go#L107.
#### QA Steps
The following python script can be used to verify both the bug in the current version as well as the fix implemented:
```python
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())
```
All CI tests need to pass.2 files changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| |||
0 commit comments