Remove scm not configurable; Fix issue with import repositories/projects

This commit is contained in:
Gavin Bunney
2019-10-08 12:08:36 -07:00
parent 2f8cfafafe
commit 4589fabad5
2 changed files with 23 additions and 13 deletions
+9 -3
View File
@@ -4,9 +4,8 @@ import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"github.com/hashicorp/terraform/helper/schema"
"io/ioutil"
)
type Project struct {
@@ -150,8 +149,15 @@ func resourceProjectRead(d *schema.ResourceData, m interface{}) error {
}
func resourceProjectExists(d *schema.ResourceData, m interface{}) (bool, error) {
var project = ""
id := d.Id()
if id != "" {
project = id
} else {
project = d.Get("key").(string)
}
client := m.(*BitbucketClient)
project := d.Get("key").(string)
repo_req, err := client.Get(fmt.Sprintf("/rest/api/1.0/projects/%s",
project,
))