providers/digitalocean: compat for changes to API for droplet size

Upstream in the digitalocean API, the size slug became a size
string, breaking pearkes/digitalocean.

https://github.com/pearkes/digitalocean/pull/1

This fixes compatibility for changes to that library.

closes #510
This commit is contained in:
Jack Pearkes 2014-11-02 14:48:40 -08:00
parent def922551e
commit ecf66ad7b5
2 changed files with 7 additions and 7 deletions

View File

@ -296,7 +296,7 @@ func resource_digitalocean_droplet_update_state(
s.Attributes["ipv4_address_private"] = droplet.IPV4Address("private")
}
s.Attributes["size"] = droplet.SizeSlug()
s.Attributes["size"] = droplet.SizeSlug
s.Attributes["status"] = droplet.Status
return s, nil

View File

@ -123,8 +123,8 @@ func testAccCheckDigitalOceanDropletAttributes(droplet *digitalocean.Droplet) re
return fmt.Errorf("Bad image_slug: %s", droplet.ImageSlug())
}
if droplet.SizeSlug() != "512mb" {
return fmt.Errorf("Bad size_slug: %s", droplet.SizeSlug())
if droplet.SizeSlug != "512mb" {
return fmt.Errorf("Bad size_slug: %s", droplet.SizeSlug)
}
if droplet.RegionSlug() != "nyc3" {
@ -141,8 +141,8 @@ func testAccCheckDigitalOceanDropletAttributes(droplet *digitalocean.Droplet) re
func testAccCheckDigitalOceanDropletRenamedAndResized(droplet *digitalocean.Droplet) resource.TestCheckFunc {
return func(s *terraform.State) error {
if droplet.SizeSlug() != "1gb" {
return fmt.Errorf("Bad size_slug: %s", droplet.SizeSlug())
if droplet.SizeSlug != "1gb" {
return fmt.Errorf("Bad size_slug: %s", droplet.SizeSlug)
}
if droplet.Name != "baz" {
@ -160,8 +160,8 @@ func testAccCheckDigitalOceanDropletAttributes_PrivateNetworkingIpv6(droplet *di
return fmt.Errorf("Bad image_slug: %s", droplet.ImageSlug())
}
if droplet.SizeSlug() != "1gb" {
return fmt.Errorf("Bad size_slug: %s", droplet.SizeSlug())
if droplet.SizeSlug != "1gb" {
return fmt.Errorf("Bad size_slug: %s", droplet.SizeSlug)
}
if droplet.RegionSlug() != "sgp1" {