~juju-qa/ubuntu/xenial/juju/2.0-rc2

« back to all changes in this revision

Viewing changes to src/github.com/juju/utils/series/supportedseries.go

  • Committer: Nicholas Skaggs
  • Date: 2016-09-30 14:39:30 UTC
  • mfrom: (1.8.1)
  • Revision ID: nicholas.skaggs@canonical.com-20160930143930-vwwhrefh6ftckccy
import upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
        return ok
48
48
}
49
49
 
50
 
var defaultVersionIDs = map[string]string{
51
 
        "arch": "rolling",
52
 
}
53
 
 
54
50
// seriesVersions provides a mapping between series names and versions.
55
51
// The values here are current as of the time of writing. On Ubuntu systems, we update
56
52
// these values from /usr/share/distro-info/ubuntu.csv to ensure we have the latest values.
57
53
// On non-Ubuntu systems, these values provide a nice fallback option.
58
54
// Exported so tests can change the values to ensure the distro-info lookup works.
59
55
var seriesVersions = map[string]string{
60
 
        "precise":     "12.04",
61
 
        "quantal":     "12.10",
62
 
        "raring":      "13.04",
63
 
        "saucy":       "13.10",
64
 
        "trusty":      "14.04",
65
 
        "utopic":      "14.10",
66
 
        "vivid":       "15.04",
67
 
        "wily":        "15.10",
68
 
        "xenial":      "16.04",
69
 
        "win2008r2":   "win2008r2",
70
 
        "win2012hvr2": "win2012hvr2",
71
 
        "win2012hv":   "win2012hv",
72
 
        "win2012r2":   "win2012r2",
73
 
        "win2012":     "win2012",
74
 
        "win2016":     "win2016",
75
 
        "win2016nano": "win2016nano",
76
 
        "win7":        "win7",
77
 
        "win8":        "win8",
78
 
        "win81":       "win81",
79
 
        "win10":       "win10",
80
 
        "centos7":     "centos7",
81
 
        "arch":        "rolling",
 
56
        "precise":          "12.04",
 
57
        "quantal":          "12.10",
 
58
        "raring":           "13.04",
 
59
        "saucy":            "13.10",
 
60
        "trusty":           "14.04",
 
61
        "utopic":           "14.10",
 
62
        "vivid":            "15.04",
 
63
        "wily":             "15.10",
 
64
        "xenial":           "16.04",
 
65
        "win2008r2":        "win2008r2",
 
66
        "win2012hvr2":      "win2012hvr2",
 
67
        "win2012hv":        "win2012hv",
 
68
        "win2012r2":        "win2012r2",
 
69
        "win2012":          "win2012",
 
70
        "win2016":          "win2016",
 
71
        "win2016nano":      "win2016nano",
 
72
        "win7":             "win7",
 
73
        "win8":             "win8",
 
74
        "win81":            "win81",
 
75
        "win10":            "win10",
 
76
        "centos7":          "centos7",
 
77
        genericLinuxSeries: genericLinuxVersion,
82
78
}
83
79
 
84
80
// versionSeries provides a mapping between versions and series names.
88
84
        "centos7": "centos7",
89
85
}
90
86
 
91
 
var archSeries = map[string]string{
92
 
        "arch": "rolling",
93
 
}
94
 
 
95
87
var ubuntuSeries = map[string]string{
96
88
        "precise": "12.04",
97
89
        "quantal": "12.10",
189
181
        if _, ok := centosSeries[series]; ok {
190
182
                return os.CentOS, nil
191
183
        }
192
 
        if _, ok := archSeries[series]; ok {
193
 
                return os.Arch, nil
 
184
        if series == genericLinuxSeries {
 
185
                return os.GenericLinux, nil
194
186
        }
195
187
        for _, val := range windowsVersions {
196
188
                if val == series {