github.com/jlmeeker/kismatic@v1.10.1-0.20180612190640-57f9005a1f1a/pkg/inspector/rule/python.go (about)

     1  package rule
     2  
     3  import (
     4  	"errors"
     5  	"fmt"
     6  )
     7  
     8  // PythonVersion rule for checking the host's python version
     9  type Python2Version struct {
    10  	Meta
    11  	SupportedVersions []string
    12  }
    13  
    14  func (p Python2Version) Name() string {
    15  	return fmt.Sprintf("Python 2 version in %v", p.SupportedVersions)
    16  }
    17  
    18  func (p Python2Version) IsRemoteRule() bool { return false }
    19  
    20  func (p Python2Version) Validate() []error {
    21  	if len(p.SupportedVersions) == 0 {
    22  		return []error{errors.New("List of supported versions is empty")}
    23  	}
    24  	return nil
    25  }