diff --git a/builder/digitalocean/step_create_droplet.go b/builder/digitalocean/step_create_droplet.go index 79a235413..a00cecac9 100644 --- a/builder/digitalocean/step_create_droplet.go +++ b/builder/digitalocean/step_create_droplet.go @@ -2,6 +2,7 @@ package digitalocean import ( "fmt" + "github.com/mitchellh/multistep" "github.com/mitchellh/packer/packer" ) @@ -53,7 +54,7 @@ func (s *stepCreateDroplet) Cleanup(state multistep.StateBag) { err := client.DestroyDroplet(s.dropletId) if err != nil { curlstr := fmt.Sprintf("curl '%v/droplets/%v/destroy?client_id=%v&api_key=%v'", - DIGITALOCEAN_API_URL, s.dropletId, c.ClientID, c.APIKey) + c.APIURL, s.dropletId, c.ClientID, c.APIKey) ui.Error(fmt.Sprintf( "Error destroying droplet. Please destroy it manually: %v", curlstr)) diff --git a/builder/digitalocean/step_create_ssh_key.go b/builder/digitalocean/step_create_ssh_key.go index e686b1ec7..cecb4f8d5 100644 --- a/builder/digitalocean/step_create_ssh_key.go +++ b/builder/digitalocean/step_create_ssh_key.go @@ -1,16 +1,17 @@ package digitalocean import ( - "code.google.com/p/gosshold/ssh" "crypto/rand" "crypto/rsa" "crypto/x509" "encoding/pem" "fmt" + "log" + + "code.google.com/p/gosshold/ssh" "github.com/mitchellh/multistep" "github.com/mitchellh/packer/common/uuid" "github.com/mitchellh/packer/packer" - "log" ) type stepCreateSSHKey struct { @@ -78,7 +79,7 @@ func (s *stepCreateSSHKey) Cleanup(state multistep.StateBag) { err := client.DestroyKey(s.keyId) curlstr := fmt.Sprintf("curl '%v/ssh_keys/%v/destroy?client_id=%v&api_key=%v'", - DIGITALOCEAN_API_URL, s.keyId, c.ClientID, c.APIKey) + c.APIURL, s.keyId, c.ClientID, c.APIKey) if err != nil { log.Printf("Error cleaning up ssh key: %v", err.Error())