Example #1
0
// proxySSH returns false if both c.proxy and
// the proxy-ssh environment configuration
// are false -- otherwise it returns true.
func (c *SSHCommon) proxySSH() (bool, error) {
	if _, err := c.ensureAPIClient(); err != nil {
		return false, err
	}
	var cfg *config.Config
	attrs, err := c.apiClient.ModelGet()
	if err == nil {
		cfg, err = config.New(config.NoDefaults, attrs)
	}
	if err != nil {
		return false, err
	}
	logger.Debugf("proxy-ssh is %v", cfg.ProxySSH())

	return cfg.ProxySSH() || c.proxy, nil
}