Esempio n. 1
0
// HookVars implements runner.Context.
func (ctx *hookContext) HookVars(paths context.Paths) ([]string, error) {
	vars := []string{
		"JUJU_CHARM_DIR=" + paths.GetCharmDir(),
		"JUJU_CONTEXT_ID=" + ctx.id,
		"JUJU_AGENT_SOCKET=" + paths.GetJujucSocket(),
		"JUJU_UNIT_NAME=" + ctx.unitName,
	}
	return append(vars, context.OSDependentEnvVars(paths)...), nil
}
Esempio n. 2
0
// HookVars implements runner.Context.
func (ctx *limitedContext) HookVars(paths context.Paths) ([]string, error) {
	vars := []string{
		"JUJU_CHARM_DIR=" + paths.GetCharmDir(),
		"JUJU_CONTEXT_ID=" + ctx.id,
		"JUJU_AGENT_SOCKET=" + paths.GetJujucSocket(),
		"JUJU_UNIT_NAME=" + ctx.unitName,
	}
	for key, val := range ctx.env {
		vars = append(vars, fmt.Sprintf("%s=%s", key, val))
	}
	return append(vars, context.OSDependentEnvVars(paths)...), nil
}