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:
parent
def922551e
commit
ecf66ad7b5
|
@ -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
|
||||
|
|
|
@ -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" {
|
||||
|
|
Loading…
Reference in New Issue