diff --git a/plugin.go b/plugin.go index 6eb7ed6..67049b3 100644 --- a/plugin.go +++ b/plugin.go @@ -17,7 +17,6 @@ var ( errMissingHost = errors.New("Error: missing server host") errMissingPasswordOrKey = errors.New("Error: can't connect without a private SSH key or password") errCommandTimeOut = errors.New("Error: command timeout") - errSetPasswordandKey = errors.New("can't set password and key at the same time") ) type ( @@ -173,10 +172,6 @@ func (p Plugin) Exec() error { return errMissingPasswordOrKey } - if len(p.Config.Key) != 0 && len(p.Config.Password) != 0 { - return errSetPasswordandKey - } - wg := sync.WaitGroup{} wg.Add(len(p.Config.Host)) errChannel := make(chan error) diff --git a/plugin_test.go b/plugin_test.go index f71c96f..dc33248 100644 --- a/plugin_test.go +++ b/plugin_test.go @@ -38,23 +38,6 @@ func TestMissingKeyOrPassword(t *testing.T) { assert.Equal(t, errMissingPasswordOrKey, err) } -func TestSetPasswordAndKey(t *testing.T) { - plugin := Plugin{ - Config{ - Host: []string{"localhost"}, - Username: "ubuntu", - Password: "1234", - Key: "1234", - }, - os.Stdout, - } - - err := plugin.Exec() - - assert.NotNil(t, err) - assert.Equal(t, errSetPasswordandKey, err) -} - func TestIncorrectPassword(t *testing.T) { plugin := Plugin{ Config: Config{