func InitJujuXDGDataHome() error {
	jujuXDGDataHome := osenv.JujuXDGDataHomeDir()
	if jujuXDGDataHome == "" {
		return errors.New("cannot determine juju data home, required environment variables are not set")
	}

	sshDir := osenv.JujuXDGDataHomePath("ssh")
	if err := ssh.LoadClientKeys(sshDir); err != nil {
		return errors.Annotate(err, "cannot load ssh client keys")
	}
	ssh.SetGoCryptoKnownHostsFile(filepath.Join(sshDir, "gocrypto_known_hosts"))

	return nil
}
// InitJujuXDGDataHome initializes the charm cache, environs/config and utils/ssh packages
// to use default paths based on the $JUJU_DATA or $HOME environment variables.
// This function should be called before running a Juju CLI command.
InitJujuXDGDataHome initializes the charm cache, environs/config and utils/ssh packages
to use default paths based on the $JUJU_DATA or $HOME environment variables.
This function should be called before running a Juju CLI command.
// InitJujuXDGDataHome initializes the charm cache environs / config and utils / ssh packages // to use default paths based on the $JUJU_DATA or $HOME environment variables . // This function should be called before running a Juju CLI command .
func InitJujuXDGDataHome() error {
	jujuXDGDataHome := osenv.JujuXDGDataHomeDir()
	if jujuXDGDataHome == "" {
		return errors.New("cannot determine juju data home, required environment variables are not set")
	}
	sshDir := osenv.JujuXDGDataHomePath("ssh")
	if err := ssh.LoadClientKeys(sshDir); err != nil {
		return errors.Annotate(err, "cannot load ssh client keys")
	}
	ssh.SetGoCryptoKnownHostsFile(filepath.Join(sshDir, "gocrypto_known_hosts"))
	return nil
}
func InitJujuXDGDataHome ( ) error { jujuXDGDataHome := osenv . JujuXDGDataHomeDir ( ) if jujuXDGDataHome == " " { return errors . New ( " " ) } sshDir := osenv . JujuXDGDataHomePath ( " " ) if err := ssh . LoadClientKeys ( sshDir ) ; err != nil { return errors . Annotate ( err , " " ) } ssh . SetGoCryptoKnownHostsFile ( filepath . Join ( sshDir , " " ) ) return nil }
InitJujuXDGDataHome initializes the charm cache, environs/config and utils/ssh packages
to use default paths based on the $JUJU_DATA or $HOME environment variables.
InitJujuXDGDataHome initializes the charm cache environs / config and utils / ssh packages to use default paths based on the $JUJU_DATA or $HOME environment variables .