Skip to content

[Bug]: model.destroy_units signature changed breaking compatability #811

@addyess

Description

@addyess

Description

in older versions of this library, the signature of destroy_units allows you to delete a list of units like this:

await model.destroy_units(*list_of_units)

because it's signature was this:

    async def destroy_unit(self, *unit_names):
        ...

    destroy_units = destroy_unit

in newer versions of this library the signature is

    async def destroy_unit(self, unit_id, destroy_storage=False, dry_run=False, force=False, max_wait=None):
        ...
    destroy_units = destroy_unit

This destroy_units simply no longer works:

a WORKAROUND for the callers is this:
await asyncio.gather(*(model.destroy_unit(_) for _ in list_of_units))

but restoring or removing destroy_units would be preferred

Urgency

Annoying bug in our test suite

Python-libjuju version

3.1.0.1

Juju version

juju 3.1

Reproduce / Test

await model.destroy_units(*matched_units)
E       TypeError: Model.destroy_unit() missing 1 required positional argument: 'unit_id'

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugindicates a bug in the project

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions