So you're running the 'install' hook directly, are you currently in a 'juju debug-hooks' session, or are you just changing into that directory?
Juju sets it during the run of a charm hook, but it is not set globally on the machine (we can't set UNIT globally anyway, because you can colocate many units on one machine). If you need to run the install hook, I *think* you could get into a charm context with "juju-run ???/install". I don't know whether you'd need to give the full path, just the last bit of the hook path, or what exactly. I *think* the hook context actually runs in the directory just above 'hooks', but I'm not 100% positive. John =:-> On Tue, May 23, 2017 at 9:49 AM, Ian Booth <ian.bo...@canonical.com> wrote: > FWIW, Juju itself still sets JUJU_UNIT_NAME > > https://github.com/juju/juju/blob/develop/worker/uniter/ > runner/context/context.go#L582 > > On 23/05/17 05:59, James Beedy wrote: > > Juju 2.1.2 > > > > I'm getting this "JUJU_UNIT_NAME not in env" error on legacy-non-reactive > > xenial charm using service_name() from hookenv. > > > > http://paste.ubuntu.com/24626263/ > > > > Did we remove this? > > > > ~James > > > > > > > > -- > Juju mailing list > Juju@lists.ubuntu.com > Modify settings or unsubscribe at: https://lists.ubuntu.com/ > mailman/listinfo/juju >
-- Juju mailing list Juju@lists.ubuntu.com Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/juju