~nskaggs/+junk/xenial-test

« back to all changes in this revision

Viewing changes to src/github.com/juju/juju/container/factory/network.go

  • Committer: Nicholas Skaggs
  • Date: 2016-10-24 20:56:05 UTC
  • Revision ID: nicholas.skaggs@canonical.com-20161024205605-z8lta0uvuhtxwzwl
Initi with beta15

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright 2015 Canonical Ltd.
 
2
// Licensed under the AGPLv3, see LICENCE file for details.
 
3
 
 
4
package factory
 
5
 
 
6
import (
 
7
        "github.com/juju/juju/container"
 
8
        "github.com/juju/juju/instance"
 
9
)
 
10
 
 
11
// DefaultNetworkBridge returns the correct network device name for the
 
12
// given container type. If there isn't a correct name or the type is
 
13
// unknown then an empty string is returned.
 
14
func DefaultNetworkBridge(cType instance.ContainerType) string {
 
15
        switch cType {
 
16
        case instance.LXD:
 
17
                return container.DefaultLxcBridge
 
18
        case instance.KVM:
 
19
                return container.DefaultKvmBridge
 
20
        default:
 
21
                return ""
 
22
        }
 
23
}