So it looks like this is caused by having this code:
line 51 plugin.go:
plugin := envcmd.Wrap(&PluginCommand{name: cmdName})
Specifically, we are wrapping PluginCommand into an environCommandWrapper, and environCommandWrapper has its own Init function. and in *that* code we have:
And that *only* succeeds if you have an environment set.
I personally do *not* have a default environment, I always specify it when I want to do something (juju bootstrap -e foo, juju deploy -e foo ubuntu, etc).
As such, there is no environment, but these plugins don't *need* an environment, it actually does nothing with them.
Note that not all plugins are ok without an environment (for example juju backup needs an environment), but the plugin should get to decide.
So it looks like this is caused by having this code: Wrap(&PluginCom mand{name: cmdName})
line 51 plugin.go:
plugin := envcmd.
Specifically, we are wrapping PluginCommand into an environCommandW rapper, and environCommandW rapper has its own Init function. and in *that* code we have:
func (w *environCommand Wrapper) Init(args []string) error { w.envName) d.Init( args)
if err := w.ensureEnvName(); err != nil {
return err
}
w.SetEnvName(
return w.EnvironComman
}
And that *only* succeeds if you have an environment set.
I personally do *not* have a default environment, I always specify it when I want to do something (juju bootstrap -e foo, juju deploy -e foo ubuntu, etc).
As such, there is no environment, but these plugins don't *need* an environment, it actually does nothing with them.
Note that not all plugins are ok without an environment (for example juju backup needs an environment), but the plugin should get to decide.