Skip to content

unit.destroy(...) references unit name rather than unit tag #950

@addyess

Description

@addyess

I was using juju==3.2.2 and discovered this issue when running unit.remove()

https://github.com/juju/python-libjuju/blame/24db195c11eb7690d6bd562b628a8640e19eb445/juju/unit.py#L114

-        return await app_facade.DestroyUnit(units=[{"unit-tag": self.name}])
+        return await app_facade.DestroyUnit(units=[{"unit-tag": self.tag}])

Discovered when trying to remove a unit

            if err_results:
>               raise errors.JujuError(err_results)
E               juju.errors.JujuError: ['"etcd/1" is not a valid tag']

.tox/integration/lib/python3.11/site-packages/juju/client/connection.py:692: JujuError

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions