示例#1
0
文件: endpoint.go 项目: jameinel/core
// Print out the addresses of the API server endpoints.
func (c *EndpointCommand) Run(ctx *cmd.Context) error {
	apiendpoint, err := juju.APIEndpointForEnv(c.EnvName, c.refresh)
	if err != nil {
		return err
	}
	return c.out.Write(ctx, apiendpoint.Addresses)
}
示例#2
0
func (s *APIEndpointForEnvSuite) TestAPIEndpointForEnvSuchName(c *gc.C) {
	defer coretesting.MakeMultipleEnvHome(c).Restore()
	_, err := juju.APIEndpointForEnv("no-such-env", false)
	c.Check(err, jc.Satisfies, errors.IsNotFound)
	c.Check(err, gc.ErrorMatches, `environment "no-such-env" not found`)
}