Merge pull request #1201 from ehazlett/remove-provider-type

Remove Provider
This commit is contained in:
Evan Hazlett 2015-05-21 14:45:55 -04:00
commit 2efadeaf09
19 changed files with 0 additions and 126 deletions

View File

@ -9,7 +9,6 @@ import (
"github.com/docker/machine/drivers"
"github.com/docker/machine/libmachine"
"github.com/docker/machine/provider"
"github.com/docker/machine/state"
)
@ -67,10 +66,6 @@ func (d ScpFakeDriver) Create() error {
return nil
}
func (d ScpFakeDriver) GetProviderType() provider.ProviderType {
return provider.Local
}
func (d ScpFakeDriver) Remove() error {
return nil
}

View File

@ -16,7 +16,6 @@ import (
"github.com/docker/machine/drivers"
"github.com/docker/machine/drivers/amazonec2/amz"
"github.com/docker/machine/log"
"github.com/docker/machine/provider"
"github.com/docker/machine/ssh"
"github.com/docker/machine/state"
"github.com/docker/machine/utils"
@ -189,10 +188,6 @@ func NewDriver(machineName string, storePath string, caCert string, privateKey s
}, nil
}
func (d *Driver) GetProviderType() provider.ProviderType {
return provider.Remote
}
func (d *Driver) AuthorizePort(ports []*drivers.Port) error {
return nil
}

View File

@ -14,7 +14,6 @@ import (
"github.com/codegangsta/cli"
"github.com/docker/machine/drivers"
"github.com/docker/machine/log"
"github.com/docker/machine/provider"
"github.com/docker/machine/ssh"
"github.com/docker/machine/state"
"github.com/docker/machine/utils"
@ -148,10 +147,6 @@ func (d *Driver) GetSSHUsername() string {
return d.SSHUser
}
func (d *Driver) GetProviderType() provider.ProviderType {
return provider.Remote
}
func (d *Driver) DriverName() string {
return "azure"
}

View File

@ -11,7 +11,6 @@ import (
"github.com/digitalocean/godo"
"github.com/docker/machine/drivers"
"github.com/docker/machine/log"
"github.com/docker/machine/provider"
"github.com/docker/machine/ssh"
"github.com/docker/machine/state"
)
@ -132,10 +131,6 @@ func (d *Driver) GetSSHUsername() string {
return d.SSHUser
}
func (d *Driver) GetProviderType() provider.ProviderType {
return provider.Remote
}
func (d *Driver) DriverName() string {
return "digitalocean"
}

View File

@ -7,7 +7,6 @@ import (
"github.com/codegangsta/cli"
"github.com/docker/machine/log"
"github.com/docker/machine/provider"
"github.com/docker/machine/state"
)
@ -58,9 +57,6 @@ type Driver interface {
// GetState returns the state that the host is in (running, stopped, etc)
GetState() (state.State, error)
// GetProviderType returns whether the instance is local/remote
GetProviderType() provider.ProviderType
// Kill stops a host forcefully
Kill() error

View File

@ -12,7 +12,6 @@ import (
"github.com/codegangsta/cli"
"github.com/docker/machine/drivers"
"github.com/docker/machine/log"
"github.com/docker/machine/provider"
"github.com/docker/machine/state"
"github.com/pyr/egoscale/src/egoscale"
)
@ -136,10 +135,6 @@ func (d *Driver) GetSSHUsername() string {
return "ubuntu"
}
func (d *Driver) GetProviderType() provider.ProviderType {
return provider.Remote
}
func (d *Driver) DriverName() string {
return "exoscale"
}

View File

@ -2,7 +2,6 @@ package fakedriver
import (
"github.com/docker/machine/drivers"
"github.com/docker/machine/provider"
"github.com/docker/machine/state"
)
@ -34,10 +33,6 @@ func (d *FakeDriver) GetMachineName() string {
return ""
}
func (d *FakeDriver) GetProviderType() provider.ProviderType {
return provider.None
}
func (d *FakeDriver) GetIP() (string, error) {
return "1.2.3.4", nil
}

View File

@ -10,7 +10,6 @@ import (
"github.com/codegangsta/cli"
"github.com/docker/machine/drivers"
"github.com/docker/machine/log"
"github.com/docker/machine/provider"
"github.com/docker/machine/state"
"github.com/docker/machine/utils"
)
@ -113,10 +112,6 @@ func (d *Driver) GetSSHUsername() string {
return d.SSHUser
}
func (d *Driver) GetProviderType() provider.ProviderType {
return provider.Remote
}
func (d *Driver) SetConfigFromFlags(flags drivers.DriverOptions) error {
d.IPAddress = flags.String("generic-ip-address")
d.SSHUser = flags.String("generic-ssh-user")

View File

@ -7,7 +7,6 @@ import (
"github.com/codegangsta/cli"
"github.com/docker/machine/drivers"
"github.com/docker/machine/log"
"github.com/docker/machine/provider"
"github.com/docker/machine/ssh"
"github.com/docker/machine/state"
)
@ -139,10 +138,6 @@ func (d *Driver) GetSSHUsername() string {
return d.SSHUser
}
func (d *Driver) GetProviderType() provider.ProviderType {
return provider.Remote
}
// DriverName returns the name of the driver.
func (d *Driver) DriverName() string {
return "google"

View File

@ -12,7 +12,6 @@ import (
"github.com/codegangsta/cli"
"github.com/docker/machine/drivers"
"github.com/docker/machine/log"
"github.com/docker/machine/provider"
"github.com/docker/machine/ssh"
"github.com/docker/machine/state"
"github.com/docker/machine/utils"
@ -127,10 +126,6 @@ func (d *Driver) GetSSHUsername() string {
return d.SSHUser
}
func (d *Driver) GetProviderType() provider.ProviderType {
return provider.Local
}
func (d *Driver) DriverName() string {
return "hyper-v"
}

View File

@ -6,7 +6,6 @@ import (
"github.com/codegangsta/cli"
"github.com/docker/machine/drivers"
"github.com/docker/machine/provider"
"github.com/docker/machine/state"
)
@ -87,10 +86,6 @@ func (d *Driver) GetState() (state.State, error) {
return state.None, nil
}
func (d *Driver) GetProviderType() provider.ProviderType {
return provider.None
}
func (d *Driver) Kill() error {
return fmt.Errorf("hosts without a driver cannot be killed")
}

View File

@ -10,7 +10,6 @@ import (
"github.com/codegangsta/cli"
"github.com/docker/machine/drivers"
"github.com/docker/machine/log"
"github.com/docker/machine/provider"
"github.com/docker/machine/ssh"
"github.com/docker/machine/state"
"github.com/docker/machine/utils"
@ -228,10 +227,6 @@ func (d *Driver) GetSSHUsername() string {
return d.SSHUser
}
func (d *Driver) GetProviderType() provider.ProviderType {
return provider.Remote
}
func (d *Driver) DriverName() string {
return "openstack"
}

View File

@ -11,7 +11,6 @@ import (
"github.com/codegangsta/cli"
"github.com/docker/machine/drivers"
"github.com/docker/machine/log"
"github.com/docker/machine/provider"
"github.com/docker/machine/ssh"
"github.com/docker/machine/state"
)
@ -99,10 +98,6 @@ func (d *Driver) GetSSHUsername() string {
return d.SSHUser
}
func (d *Driver) GetProviderType() provider.ProviderType {
return provider.Remote
}
func GetCreateFlags() []cli.Flag {
// Set hourly billing to true by default since codegangsta cli doesn't take default bool values
if os.Getenv("SOFTLAYER_HOURLY_BILLING") == "" {

View File

@ -19,7 +19,6 @@ import (
"github.com/codegangsta/cli"
"github.com/docker/machine/drivers"
"github.com/docker/machine/log"
"github.com/docker/machine/provider"
"github.com/docker/machine/ssh"
"github.com/docker/machine/state"
"github.com/docker/machine/utils"
@ -126,10 +125,6 @@ func (d *Driver) GetSSHUsername() string {
return d.SSHUser
}
func (d *Driver) GetProviderType() provider.ProviderType {
return provider.Local
}
func (d *Driver) DriverName() string {
return "virtualbox"
}

View File

@ -22,7 +22,6 @@ import (
"github.com/codegangsta/cli"
"github.com/docker/machine/drivers"
"github.com/docker/machine/log"
"github.com/docker/machine/provider"
"github.com/docker/machine/ssh"
"github.com/docker/machine/state"
"github.com/docker/machine/utils"
@ -132,10 +131,6 @@ func (d *Driver) GetSSHUsername() string {
return d.SSHUser
}
func (d *Driver) GetProviderType() provider.ProviderType {
return provider.Local
}
func (d *Driver) DriverName() string {
return "vmwarefusion"
}

View File

@ -15,7 +15,6 @@ import (
"github.com/codegangsta/cli"
"github.com/docker/machine/drivers"
"github.com/docker/machine/log"
"github.com/docker/machine/provider"
"github.com/docker/machine/ssh"
"github.com/docker/machine/state"
"github.com/docker/machine/utils"
@ -182,10 +181,6 @@ func (d *Driver) GetSSHUsername() string {
return d.SSHUser
}
func (d *Driver) GetProviderType() provider.ProviderType {
return provider.Remote
}
// Driver interface implementation
func (d *Driver) DriverName() string {
return "vmwarevcloudair"

View File

@ -21,7 +21,6 @@ import (
"github.com/codegangsta/cli"
"github.com/docker/machine/drivers"
"github.com/docker/machine/drivers/vmwarevsphere/errors"
"github.com/docker/machine/provider"
"github.com/docker/machine/ssh"
"github.com/docker/machine/state"
"github.com/docker/machine/utils"
@ -181,10 +180,6 @@ func (d *Driver) GetSSHUsername() string {
return d.SSHUser
}
func (d *Driver) GetProviderType() provider.ProviderType {
return provider.Local
}
func (d *Driver) DriverName() string {
return "vmwarevsphere"
}

View File

@ -1,25 +0,0 @@
package provider
// ProviderType represents the type of a provider for a machine
type ProviderType int
const (
None ProviderType = iota
Local
Remote
)
var providerTypes = []string{
"",
"Local",
"Remote",
}
// Given a type, returns its string representation
func (t ProviderType) String() string {
if int(t) >= 0 && int(t) < len(providerTypes) {
return providerTypes[t]
} else {
return ""
}
}

View File

@ -1,17 +0,0 @@
package provider
import (
"testing"
)
func TestProviderType(t *testing.T) {
if None.String() != "" {
t.Fatal("None provider type should be empty string")
}
if Local.String() != "Local" {
t.Fatal("Local provider type should be 'Local'")
}
if Remote.String() != "Remote" {
t.Fatal("Remote provider type should be 'Remote'")
}
}