Skip to content

Adding charm X while cwd is X is tricky #173

@simonklb

Description

@simonklb

Had to dig through the code a bit before finding out what was happening.

In deployer the name of the directory you're in becomes the default charm name that is looked up when determining the charm path. In my case my cwd was /home/ubuntu and I was trying to add the Ubuntu charm to my Amulet test. But every time I was running the test I ended up with Exception: Charm not found.

The reason was that it was trying to lookup the charm as a local charm rather than from the charmstore due to https://github.com/juju/amulet/blob/master/amulet/charm.py#L54 and then https://github.com/juju/amulet/blob/master/amulet/charm.py#L39.

Fixed it by setting the JUJU_TEST_CHARM environment variable, but it wasn't very obvious from the get go what was going on.

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