// New returns a new Config with no options set. func New(series string) (CloudConfig, error) { os, err := version.GetOSFromSeries(series) if err != nil { return nil, err } switch os { case version.Windows: renderer, _ := shell.NewRenderer("powershell") return &windowsCloudConfig{ &cloudConfig{ series: series, renderer: renderer, attrs: make(map[string]interface{}), }, }, nil case version.Ubuntu: renderer, _ := shell.NewRenderer("bash") return &ubuntuCloudConfig{ &cloudConfig{ series: series, paccmder: commands.NewAptPackageCommander(), pacconfer: config.NewAptPackagingConfigurer(series), renderer: renderer, attrs: make(map[string]interface{}), }, }, nil case version.CentOS: renderer, _ := shell.NewRenderer("bash") return ¢OSCloudConfig{ &cloudConfig{ series: series, paccmder: commands.NewYumPackageCommander(), pacconfer: config.NewYumPackagingConfigurer(series), renderer: renderer, attrs: make(map[string]interface{}), }, }, nil default: return nil, errors.NotFoundf("cloudconfig for series %q", series) } }
func (s *YumSuite) SetUpSuite(c *gc.C) { s.IsolationSuite.SetUpSuite(c) s.paccmder = commands.NewYumPackageCommander() s.pacman = manager.NewYumPackageManager() }
func (s *YumSuite) SetUpSuite(c *gc.C) { s.paccmder = commands.NewYumPackageCommander() }
func (s *ManagerSuite) TearDownTest(c *gc.C) { s.IsolationSuite.TearDownTest(c) } func (s *ManagerSuite) TearDownSuite(c *gc.C) { s.IsolationSuite.TearDownSuite(c) } var ( // aptCmder is the commands.PackageCommander for apt-based // systems whose commands will be checked against. aptCmder = commands.NewAptPackageCommander() // yumCmder is the commands.PackageCommander for yum-based // systems whose commands will be checked against. yumCmder = commands.NewYumPackageCommander() // testedPackageName is the package name used in all // single-package testing scenarios. testedPackageName = "test-package" // testedRepoName is the repository name used in all // repository-related tests. testedRepoName = "some-repo" // testedProxySettings is the set of proxy settings used in // all proxy-related tests. testedProxySettings = proxy.Settings{ Http: "http://some-proxy.domain", Https: "https://some-proxy.domain", Ftp: "ftp://some-proxy.domain",
// NewYumPackageManager returns a PackageManager for yum-based systems. func NewYumPackageManager() PackageManager { return &yum{basePackageManager{commands.NewYumPackageCommander()}} }