本文整理汇总了Golang中github.com/juju/juju/cloudinit.Config.SetAptGetWrapper方法的典型用法代码示例。如果您正苦于以下问题:Golang Config.SetAptGetWrapper方法的具体用法?Golang Config.SetAptGetWrapper怎么用?Golang Config.SetAptGetWrapper使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/juju/juju/cloudinit.Config
的用法示例。
在下文中一共展示了Config.SetAptGetWrapper方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: AddAptCommands
// AddAptCommands update the cloudinit.Config instance with the necessary
// packages, the request to do the apt-get update/upgrade on boot, and adds
// the apt proxy settings if there are any.
func AddAptCommands(
proxySettings proxy.Settings,
c *cloudinit.Config,
addUpdateScripts bool,
addUpgradeScripts bool,
) {
// Check preconditions
if c == nil {
panic("c is nil")
}
// Bring packages up-to-date.
c.SetAptUpdate(addUpdateScripts)
c.SetAptUpgrade(addUpgradeScripts)
c.SetAptGetWrapper("eatmydata")
// If we're not doing an update, adding these packages is
// meaningless.
if addUpdateScripts {
c.AddPackage("curl")
c.AddPackage("cpu-checker")
// TODO(axw) 2014-07-02 #1277359
// Don't install bridge-utils in cloud-init;
// leave it to the networker worker.
c.AddPackage("bridge-utils")
c.AddPackage("rsyslog-gnutls")
}
// Write out the apt proxy settings
if (proxySettings != proxy.Settings{}) {
filename := apt.ConfFile
c.AddBootCmd(fmt.Sprintf(
`[ -f %s ] || (printf '%%s\n' %s > %s)`,
filename,
shquote(apt.ProxyContent(proxySettings)),
filename))
}
}
示例2: AddAptCommands
// AddAptCommands update the cloudinit.Config instance with the necessary
// packages, the request to do the apt-get update/upgrade on boot, and adds
// the apt proxy settings if there are any.
func AddAptCommands(proxySettings proxy.Settings, c *cloudinit.Config) {
// Bring packages up-to-date.
c.SetAptUpdate(true)
c.SetAptUpgrade(true)
c.SetAptGetWrapper("eatmydata")
c.AddPackage("curl")
c.AddPackage("cpu-checker")
// TODO(axw) 2014-07-02 #1277359
// Don't install bridge-utils in cloud-init;
// leave it to the networker worker.
c.AddPackage("bridge-utils")
c.AddPackage("rsyslog-gnutls")
// Write out the apt proxy settings
if (proxySettings != proxy.Settings{}) {
filename := apt.ConfFile
c.AddBootCmd(fmt.Sprintf(
`[ -f %s ] || (printf '%%s\n' %s > %s)`,
filename,
shquote(apt.ProxyContent(proxySettings)),
filename))
}
}