Skip to content

Commit

Permalink
Simplify code
Browse files Browse the repository at this point in the history
Signed-off-by: David Gageot <david@gageot.net>
  • Loading branch information
dgageot committed Dec 22, 2015
1 parent 181a1d4 commit cdfa729
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions drivers/generic/generic.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,13 @@ func (d *Driver) GetURL() (string, error) {

func (d *Driver) GetState() (state.State, error) {
address := net.JoinHostPort(d.IPAddress, strconv.Itoa(d.SSHPort))

_, err := net.DialTimeout("tcp", address, defaultTimeout)
var st state.State
if err != nil {
st = state.Stopped
} else {
st = state.Running
return state.Stopped, nil
}
return st, nil

return state.Running, nil
}

func (d *Driver) Start() error {
Expand Down

0 comments on commit cdfa729

Please sign in to comment.