~wwitzel3/juju-core/009-ha-rsyslog-api

« back to all changes in this revision

Viewing changes to provider/local/lxc.go

  • Committer: Wayne Witzel III
  • Date: 2014-05-22 13:23:37 UTC
  • mfrom: (2743.1.10 ha-rsyslog-api)
  • Revision ID: wayne.witzel@canonical.com-20140522132337-m9py79a81mjdm9su
merge mfoord

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// Copyright 2014 Canonical Ltd.
2
 
// Licensed under the AGPLv3, see LICENCE file for details.
3
 
 
4
 
package local
5
 
 
6
 
import (
7
 
        "strconv"
8
 
 
9
 
        "launchpad.net/juju-core/instance"
10
 
        "launchpad.net/juju-core/version"
11
 
)
12
 
 
13
 
// releaseVersion is a function that returns a string representing the
14
 
// DISTRIB_RELEASE from the /etc/lsb-release file.
15
 
var releaseVersion = version.ReleaseVersion
16
 
 
17
 
func useFastLXC(containerType instance.ContainerType) bool {
18
 
        if containerType != instance.LXC {
19
 
                return false
20
 
        }
21
 
        release := releaseVersion()
22
 
        if release == "" {
23
 
                return false
24
 
        }
25
 
        value, err := strconv.ParseFloat(release, 64)
26
 
        if err != nil {
27
 
                return false
28
 
        }
29
 
        return value >= 14.04
30
 
}