Documentation ¶
Index ¶
- Variables
- func ConfigProxy() (string, error)
- func DetectProxies() (result proxy.Settings, err error)
- func GetInstall(packages ...string) error
- func GetPreparePackages(packages []string, series string) [][]string
- func IsPackageInstalled(packageName string) bool
- func ProxyContent(proxySettings proxy.Settings) string
Constants ¶
This section is empty.
Variables ¶
var CommandOutput = (*exec.Cmd).CombinedOutput
CommandOutput calls cmd.Output, this is used as an overloading point so we can test what *would* be run without actually executing another program
var ( // ConfFile is the full file path for the proxy settings that are // written by cloud-init and the machine environ worker. ConfFile = "/etc/apt/apt.conf.d/42-juju-proxy-settings" )
Functions ¶
func ConfigProxy ¶
ConfigProxy will consult apt-config about the configured proxy settings. If there are no proxy settings configured, an empty string is returned.
func DetectProxies ¶
DetectProxies will parse the results of ConfigProxy to return a ProxySettings instance.
func GetInstall ¶
GetInstall runs 'apt-get install packages' for the packages listed here
func GetPreparePackages ¶
GetPreparePackages returns a slice of installCommands. Each item in the slice is suitable for passing directly to Apt. It inspects the series passed to it and properly generates an installCommand entry with a --target-release should the series be an LTS release with cloud archive packages.
func IsPackageInstalled ¶
IsPackageInstalled uses dpkg-query to determine if the `packageName` package is installed.
func ProxyContent ¶
ProxyContent produces the format expected by the apt config files from the ProxySettings struct.
Types ¶
This section is empty.