~juju-qa/ubuntu/trusty/juju/juju-1.25.8

« back to all changes in this revision

Viewing changes to src/github.com/juju/utils/isubuntu.go

  • Committer: Nicholas Skaggs
  • Date: 2016-12-02 18:01:10 UTC
  • Revision ID: nicholas.skaggs@canonical.com-20161202180110-dl1helep8qfebmhx
ImportĀ upstreamĀ 1.25.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright 2011, 2012, 2013 Canonical Ltd.
 
2
// Licensed under the LGPLv3, see LICENCE file for details.
 
3
 
 
4
package utils
 
5
 
 
6
import (
 
7
        "strings"
 
8
)
 
9
 
 
10
// IsUbuntu executes lxb_release to see if the host OS is Ubuntu.
 
11
func IsUbuntu() bool {
 
12
        out, err := RunCommand("lsb_release", "-i", "-s")
 
13
        if err != nil {
 
14
                return false
 
15
        }
 
16
        return strings.TrimSpace(out) == "Ubuntu"
 
17
}