amulet icon indicating copy to clipboard operation
amulet copied to clipboard

Adding charm X while cwd is X is tricky

Open simonklb opened this issue 8 years ago • 0 comments

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.

simonklb avatar Feb 16 '17 15:02 simonklb