示例#1
0
// newWorker is not currently tested; it should eventually replace New as the
// package's exposed factory func, and then all tests should pass through it.
func newWorker(a agent.Agent, apiCaller base.APICaller) (worker.Worker, error) {
	agentConfig := a.CurrentConfig()
	switch tag := agentConfig.Tag().(type) {
	case names.MachineTag, names.UnitTag:
	default:
		return nil, errors.Errorf("unknown agent type: %T", tag)
	}

	// TODO(fwereade): This shouldn't be an "environment" facade, it
	// should be specific to the proxyupdater, and be watching for
	// *proxy settings* changes, not just watching the "environment".
	return NewWorker(proxyupdater.NewFacade(apiCaller))
}
示例#2
0
func (s *ProxyUpdaterSuite) SetUpTest(c *gc.C) {
	s.JujuConnSuite.SetUpTest(c)
	s.apiRoot, s.machine = s.OpenAPIAsNewMachine(c)
	// Create the environment API facade.
	s.proxyUpdaterAPI = apiproxyupdater.NewFacade(s.apiRoot)
	c.Assert(s.proxyUpdaterAPI, gc.NotNil)

	proxyDir := c.MkDir()
	s.PatchValue(&proxyupdater.ProxyDirectory, proxyDir)
	s.started = make(chan struct{})
	s.PatchValue(&proxyupdater.Started, s.setStarted)
	s.PatchValue(&pacconfig.AptProxyConfigFile, path.Join(proxyDir, "juju-apt-proxy"))
	s.proxyFile = path.Join(proxyDir, proxyupdater.ProxyFile)
}
示例#3
0
文件: manifold.go 项目: exekias/juju
// newWorker is not currently tested; it should eventually replace New as the
// package's exposed factory func, and then all tests should pass through it.
func newWorker(apiCaller base.APICaller) (worker.Worker, error) {
	// TODO(fwereade): This shouldn't be an "environment" facade, it
	// should be specific to the proxyupdater, and be watching for
	// *proxy settings* changes, not just watching the "environment".
	return NewWorker(proxyupdater.NewFacade(apiCaller))
}
示例#4
0
文件: manifold.go 项目: pmatulis/juju
// newWorker is not currently tested; it should eventually replace New as the
// package's exposed factory func, and then all tests should pass through it.
func newWorker(apiCaller base.APICaller) (worker.Worker, error) {
	return NewWorker(proxyupdater.NewFacade(apiCaller), false)
}