juju / python-libjuju

Python library for the Juju API
Apache License 2.0
59 stars 99 forks source link

fix zones constrains list parsing #1054

Closed luissimas closed 2 months ago

luissimas commented 4 months ago

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 commented 4 months ago

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

jujubot commented 4 months ago

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

Aflynn50 commented 3 months ago

/merge

Aflynn50 commented 3 months ago

Hey @luissimas, we can't currently merge your contribution as the commit is not signed and our repo has a rule disallowing merges of unverified commits.

Would you be able to follow this GitHub guide and force push a verified version of your commit?

luissimas commented 3 months ago

Hey @luissimas, we can't currently merge your contribution as the commit is not signed and our repo has a rule disallowing merges of unverified commits.

Would you be able to follow this GitHub guide and force push a verified version of your commit?

Done. I've also rebased on the main branch.

Aflynn50 commented 3 months ago

/merge

Aflynn50 commented 3 months ago

/build

cderici commented 3 months ago

/build

Aflynn50 commented 3 months ago

/merge

cderici commented 2 months ago

/build

cderici commented 2 months ago

/build

cderici commented 2 months ago

/merge