* Re-enabled ND tests

* Reverted changes to README.md since there is another PR to update it.
This commit is contained in:
Cameron Crockatt
2020-07-17 15:43:47 -04:00
committed by Emily Li
parent b3ee8fd46c
commit a38a9f4d15
7 changed files with 33 additions and 24 deletions
+3 -5
View File
@@ -2,10 +2,8 @@ package bitbucket
import (
"fmt"
"net/url"
"strings"
"github.com/hashicorp/terraform/helper/schema"
"net/url"
)
func resourceGroup() *schema.Resource {
@@ -39,9 +37,9 @@ func resourceGroupCreate(d *schema.ResourceData, m interface{}) error {
groupName := d.Get("name").(string)
importIfExists := d.Get("import_if_exists").(bool)
var newResource = true
_, err := client.Post(fmt.Sprintf("/rest/api/1.0/admin/groups?name=%s", url.QueryEscape(groupName)), nil)
response, err := client.Post(fmt.Sprintf("/rest/api/1.0/admin/groups?name=%s", url.QueryEscape(groupName)), nil)
if err != nil {
if importIfExists && strings.Contains(err.Error(), "API Error: 409") {
if importIfExists && response.StatusCode == 409 {
newResource = false
} else {
return err