check for a couple errors
This commit is contained in:
parent
35578d9ed1
commit
cc11ec3566
|
@ -69,7 +69,10 @@ func (c *Communicator) Upload(dst string, r io.Reader, fi *os.FileInfo) error {
|
||||||
return fmt.Errorf("Error preparing shell script: %s", err)
|
return fmt.Errorf("Error preparing shell script: %s", err)
|
||||||
}
|
}
|
||||||
defer os.Remove(tf.Name())
|
defer os.Remove(tf.Name())
|
||||||
io.Copy(tf, r)
|
|
||||||
|
if _, err := io.Copy(tf, r); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
cpCmd, err := c.CmdWrapper(fmt.Sprintf("cp %s %s", tf.Name(), dst))
|
cpCmd, err := c.CmdWrapper(fmt.Sprintf("cp %s %s", tf.Name(), dst))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -342,7 +342,10 @@ func (s *StepRunSourceInstance) Cleanup(state multistep.StateBag) {
|
||||||
Target: "cancelled",
|
Target: "cancelled",
|
||||||
}
|
}
|
||||||
|
|
||||||
WaitForState(&stateChange)
|
_, err := WaitForState(&stateChange)
|
||||||
|
if err != nil {
|
||||||
|
ui.Error(err.Error())
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -359,6 +362,9 @@ func (s *StepRunSourceInstance) Cleanup(state multistep.StateBag) {
|
||||||
Target: "terminated",
|
Target: "terminated",
|
||||||
}
|
}
|
||||||
|
|
||||||
WaitForState(&stateChange)
|
_, err := WaitForState(&stateChange)
|
||||||
|
if err != nil {
|
||||||
|
ui.Error(err.Error())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -250,7 +250,7 @@ func (c *comm) newSession() (session *ssh.Session, err error) {
|
||||||
|
|
||||||
func (c *comm) reconnect() (err error) {
|
func (c *comm) reconnect() (err error) {
|
||||||
if c.conn != nil {
|
if c.conn != nil {
|
||||||
c.conn.Close()
|
return c.conn.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the conn and client to nil since we'll recreate it
|
// Set the conn and client to nil since we'll recreate it
|
||||||
|
|
Loading…
Reference in New Issue