diff --git a/go.mod b/go.mod index d3189ed45..e186adf1c 100644 --- a/go.mod +++ b/go.mod @@ -7,6 +7,7 @@ require ( github.com/Azure/go-ntlmssp v0.0.0-20180810175552-4a21cbd618b4 // indirect github.com/ChrisTrenkamp/goxpath v0.0.0-20170625215350-4fe035839290 github.com/NaverCloudPlatform/ncloud-sdk-go v0.0.0-20180110055012-c2e73f942591 + github.com/Telmate/proxmox-api-go v0.0.0-20190410200643-f08824d5082d github.com/abdullin/seq v0.0.0-20160510034733-d5467c17e7af // indirect github.com/aliyun/aliyun-oss-go-sdk v0.0.0-20170113022742-e6dbea820a9f github.com/antchfx/xpath v0.0.0-20170728053731-b5c552e1acbd // indirect diff --git a/vendor/github.com/Telmate/proxmox-api-go/proxmox/client.go b/vendor/github.com/Telmate/proxmox-api-go/proxmox/client.go index 7b97b9505..50f2d9e09 100644 --- a/vendor/github.com/Telmate/proxmox-api-go/proxmox/client.go +++ b/vendor/github.com/Telmate/proxmox-api-go/proxmox/client.go @@ -393,14 +393,16 @@ func (c *Client) CreateQemuVm(node string, vmParams map[string]interface{}) (exi resp, err = c.session.Post(url, nil, nil, &reqbody) defer resp.Body.Close() if err != nil { + // This might not work if we never got a body. We'll ignore errors in trying to read, + // but extract the body if possible to give any error information back in the exitStatus b, _ := ioutil.ReadAll(resp.Body) exitStatus = string(b) - return + return exitStatus, err } taskResponse, err := ResponseJSON(resp) if err != nil { - return + return "", err } exitStatus, err = c.WaitForCompletion(taskResponse) // Delete VM disks if the VM didn't create.