util: distro: Rename functions to avoid golang stutter warning
This commit is contained in:
@@ -206,7 +206,7 @@ func (obj *VirtBuilderRes) getGuestfs() ([]string, error) {
|
|||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
packages, exists := distroUtil.DistroToGuestfsPackages(distro)
|
packages, exists := distroUtil.ToGuestfsPackages(distro)
|
||||||
if !exists {
|
if !exists {
|
||||||
// TODO: patches welcome!
|
// TODO: patches welcome!
|
||||||
return nil, fmt.Errorf("os/version is not supported")
|
return nil, fmt.Errorf("os/version is not supported")
|
||||||
@@ -220,7 +220,7 @@ func (obj *VirtBuilderRes) getGuestfs() ([]string, error) {
|
|||||||
func (obj *VirtBuilderRes) getDeps() ([]string, error) {
|
func (obj *VirtBuilderRes) getDeps() ([]string, error) {
|
||||||
// TODO: Improve this function as things evolve.
|
// TODO: Improve this function as things evolve.
|
||||||
distro := strings.TrimSuffix(obj.OSVersion, "-") // fedora- or debian-
|
distro := strings.TrimSuffix(obj.OSVersion, "-") // fedora- or debian-
|
||||||
packages, exists := distroUtil.DistroToBootstrapPackages(distro)
|
packages, exists := distroUtil.ToBootstrapPackages(distro)
|
||||||
if !exists {
|
if !exists {
|
||||||
// TODO: patches welcome!
|
// TODO: patches welcome!
|
||||||
return nil, fmt.Errorf("os version is not supported")
|
return nil, fmt.Errorf("os version is not supported")
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ func init() {
|
|||||||
// for bootstrapping new machines which will need these installed before they
|
// for bootstrapping new machines which will need these installed before they
|
||||||
// can run mgmt.
|
// can run mgmt.
|
||||||
func BootstrapPackages(ctx context.Context, input []types.Value) (types.Value, error) {
|
func BootstrapPackages(ctx context.Context, input []types.Value) (types.Value, error) {
|
||||||
packages, exists := distroUtil.DistroToBootstrapPackages(input[0].Str())
|
packages, exists := distroUtil.ToBootstrapPackages(input[0].Str())
|
||||||
if !exists {
|
if !exists {
|
||||||
return nil, fmt.Errorf("missing distro")
|
return nil, fmt.Errorf("missing distro")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -85,17 +85,17 @@ var (
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
// DistroToBootstrapPackages returns the list of packages corresponding to the
|
// ToBootstrapPackages returns the list of packages corresponding to the distro
|
||||||
// distro for bootstrapping. This returns false if the value doesn't exist.
|
// for bootstrapping. This returns false if the value doesn't exist.
|
||||||
func DistroToBootstrapPackages(distro string) ([]string, bool) {
|
func ToBootstrapPackages(distro string) ([]string, bool) {
|
||||||
l, exists := MapDistroToBootstrapPackages[distro]
|
l, exists := MapDistroToBootstrapPackages[distro]
|
||||||
return l, exists
|
return l, exists
|
||||||
}
|
}
|
||||||
|
|
||||||
// DistroToGuestfsPackages returns the list of packages corresponding to the
|
// ToGuestfsPackages returns the list of packages corresponding to the distro
|
||||||
// distro for running the virt-builder software and guestfs suite. This returns
|
// for running the virt-builder software and guestfs suite. This returns false
|
||||||
// false if the value doesn't exist.
|
// if the value doesn't exist.
|
||||||
func DistroToGuestfsPackages(distro string) ([]string, bool) {
|
func ToGuestfsPackages(distro string) ([]string, bool) {
|
||||||
l, exists := MapDistroToGuestfsPackages[distro]
|
l, exists := MapDistroToGuestfsPackages[distro]
|
||||||
return l, exists
|
return l, exists
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user