Comment 4 for bug 1359170

Revision history for this message
John A Meinel (jameinel) wrote : Re: arguments no longer passed to plugins

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:

func (w *environCommandWrapper) Init(args []string) error {
 if err := w.ensureEnvName(); err != nil {
  return err
 }
 w.SetEnvName(w.envName)
 return w.EnvironCommand.Init(args)
}

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.