Skip to content

fix zones constrains list parsing#1051

Closed
luissimas wants to merge 1 commit intojuju:masterfrom
luissimas:master
Closed

fix zones constrains list parsing#1051
luissimas wants to merge 1 commit intojuju:masterfrom
luissimas:master

Conversation

@luissimas
Copy link
Copy Markdown
Contributor

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:

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.

@jujubot
Copy link
Copy Markdown
Contributor

jujubot commented May 17, 2024

Thanks for opening a pull request! Please follow the instructions here to ensure your pull request is ready for review. Then, a maintainer will review your patch.

@hpidcock @anvial

1 similar comment
@jujubot
Copy link
Copy Markdown
Contributor

jujubot commented May 17, 2024

Thanks for opening a pull request! Please follow the instructions here to ensure your pull request is ready for review. Then, a maintainer will review your patch.

@hpidcock @anvial

@luissimas
Copy link
Copy Markdown
Contributor Author

Closing this one in favor of #1054 since it's merging from its own branch instead of master.

@luissimas luissimas closed this May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect parsing of zones constraint

2 participants