Skip to content

Commit 8bbfc6e

Browse files
committed
Remove unused code
Signed-off-by: David Gageot <david@gageot.net>
1 parent 8967506 commit 8bbfc6e

File tree

5 files changed

+2
-51
lines changed

5 files changed

+2
-51
lines changed

commands/commands.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -156,20 +156,8 @@ func getFirstArgHost(c CommandLine) (*host.Host, error) {
156156
store := getStore(c)
157157
hostName := c.Args().First()
158158

159-
exists, err := store.Exists(hostName)
160-
if err != nil {
161-
return nil, fmt.Errorf("Error checking if host %q exists: %s", hostName, err)
162-
}
163-
if !exists {
164-
return nil, fmt.Errorf("Host %q does not exist", hostName)
165-
}
166-
167159
h, err := loadHost(store, hostName)
168160
if err != nil {
169-
// I guess I feel OK with bailing here since if we can't get
170-
// the host reliably we're definitely not going to be able to
171-
// do anything else interesting, but also this premature exit
172-
// feels wrong to me. Let's revisit it later.
173161
return nil, fmt.Errorf("Error trying to get host %q: %s", hostName, err)
174162
}
175163

commands/commands_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"github.com/docker/machine/drivers/fakedriver"
99
"github.com/docker/machine/libmachine/host"
1010
"github.com/docker/machine/libmachine/hosttest"
11-
"github.com/docker/machine/libmachine/persisttest"
1211
"github.com/docker/machine/libmachine/state"
1312
"github.com/stretchr/testify/assert"
1413
)
@@ -104,7 +103,7 @@ func TestRunActionForeachMachine(t *testing.T) {
104103
}
105104

106105
func TestPrintIPEmptyGivenLocalEngine(t *testing.T) {
107-
defer persisttest.Cleanup()
106+
defer cleanup()
108107
host, _ := hosttest.GetDefaultTestHost()
109108

110109
out, w := captureStdout()

libmachine/hosttest/default_test_host.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import (
1111

1212
const (
1313
DefaultHostName = "test-host"
14-
HostTestDriverName = "none"
1514
HostTestCaCert = "test-cert"
1615
HostTestPrivateKey = "test-key"
1716
)

libmachine/mcnerror/errors.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ import (
66
)
77

88
var (
9-
ErrInvalidHostname = errors.New("Invalid hostname specified. Allowed hostname chars are: 0-9a-zA-Z . -")
10-
ErrUnknownProviderType = errors.New("Unknown hypervisor type")
9+
ErrInvalidHostname = errors.New("Invalid hostname specified. Allowed hostname chars are: 0-9a-zA-Z . -")
1110
)
1211

1312
type ErrHostDoesNotExist struct {

libmachine/persisttest/default_test_store.go

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)