diff --git a/commands/scp_test.go b/commands/scp_test.go index f32d00c309..76ac8a8f0c 100644 --- a/commands/scp_test.go +++ b/commands/scp_test.go @@ -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 } diff --git a/drivers/amazonec2/amazonec2.go b/drivers/amazonec2/amazonec2.go index 44555b8445..60e9199bd0 100644 --- a/drivers/amazonec2/amazonec2.go +++ b/drivers/amazonec2/amazonec2.go @@ -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 } diff --git a/drivers/azure/azure.go b/drivers/azure/azure.go index 9c94566499..73ef4774db 100644 --- a/drivers/azure/azure.go +++ b/drivers/azure/azure.go @@ -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" } diff --git a/drivers/digitalocean/digitalocean.go b/drivers/digitalocean/digitalocean.go index 7aa0baf3b3..3b65ca26f2 100644 --- a/drivers/digitalocean/digitalocean.go +++ b/drivers/digitalocean/digitalocean.go @@ -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" } diff --git a/drivers/drivers.go b/drivers/drivers.go index 2c86432912..0f17afa48d 100644 --- a/drivers/drivers.go +++ b/drivers/drivers.go @@ -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 diff --git a/drivers/exoscale/exoscale.go b/drivers/exoscale/exoscale.go index ce0ff79bf2..d9c43cecae 100644 --- a/drivers/exoscale/exoscale.go +++ b/drivers/exoscale/exoscale.go @@ -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" } diff --git a/drivers/fakedriver/fakedriver.go b/drivers/fakedriver/fakedriver.go index d7fd999154..13eae5a109 100644 --- a/drivers/fakedriver/fakedriver.go +++ b/drivers/fakedriver/fakedriver.go @@ -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 } diff --git a/drivers/generic/generic.go b/drivers/generic/generic.go index 42f8b8f416..ce7ba301fa 100644 --- a/drivers/generic/generic.go +++ b/drivers/generic/generic.go @@ -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") diff --git a/drivers/google/google.go b/drivers/google/google.go index c5c1f7c66c..4ad7c62ca6 100644 --- a/drivers/google/google.go +++ b/drivers/google/google.go @@ -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" diff --git a/drivers/hyperv/hyperv_windows.go b/drivers/hyperv/hyperv_windows.go index efcb4fd636..c64d594a7e 100644 --- a/drivers/hyperv/hyperv_windows.go +++ b/drivers/hyperv/hyperv_windows.go @@ -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" } diff --git a/drivers/none/none.go b/drivers/none/none.go index b6a92f876e..f816f456ff 100644 --- a/drivers/none/none.go +++ b/drivers/none/none.go @@ -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") } diff --git a/drivers/openstack/openstack.go b/drivers/openstack/openstack.go index 8aed28c113..d6e6bdf862 100644 --- a/drivers/openstack/openstack.go +++ b/drivers/openstack/openstack.go @@ -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" } diff --git a/drivers/softlayer/driver.go b/drivers/softlayer/driver.go index a58a08dc2a..87d0a4de38 100644 --- a/drivers/softlayer/driver.go +++ b/drivers/softlayer/driver.go @@ -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") == "" { diff --git a/drivers/virtualbox/virtualbox.go b/drivers/virtualbox/virtualbox.go index a61f365085..b10e5970b4 100644 --- a/drivers/virtualbox/virtualbox.go +++ b/drivers/virtualbox/virtualbox.go @@ -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" } diff --git a/drivers/vmwarefusion/fusion_darwin.go b/drivers/vmwarefusion/fusion_darwin.go index f485334e7b..507bb86428 100644 --- a/drivers/vmwarefusion/fusion_darwin.go +++ b/drivers/vmwarefusion/fusion_darwin.go @@ -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" } diff --git a/drivers/vmwarevcloudair/vcloudair.go b/drivers/vmwarevcloudair/vcloudair.go index 54f9a9e29c..1e38be2198 100644 --- a/drivers/vmwarevcloudair/vcloudair.go +++ b/drivers/vmwarevcloudair/vcloudair.go @@ -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" diff --git a/drivers/vmwarevsphere/vsphere.go b/drivers/vmwarevsphere/vsphere.go index a9aea5577c..46fb382bbd 100644 --- a/drivers/vmwarevsphere/vsphere.go +++ b/drivers/vmwarevsphere/vsphere.go @@ -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" } diff --git a/provider/provider.go b/provider/provider.go deleted file mode 100644 index 713c62cad1..0000000000 --- a/provider/provider.go +++ /dev/null @@ -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 "" - } -} diff --git a/provider/provider_test.go b/provider/provider_test.go deleted file mode 100644 index 60a5ebcf84..0000000000 --- a/provider/provider_test.go +++ /dev/null @@ -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'") - } -}