This commit is contained in:
Jon Perritt 2015-01-27 10:19:11 -07:00
parent a707f8414c
commit 17b137c972
6 changed files with 15 additions and 17 deletions

View File

@ -32,9 +32,9 @@ func Provider() terraform.ResourceProvider {
Default: "", Default: "",
}, },
"tenant_name": &schema.Schema{ "tenant_name": &schema.Schema{
Type: schema.TypeString, Type: schema.TypeString,
Optional: true, Optional: true,
DefaultFunc: envDefaultFunc("OS_TENANT_NAME"), DefaultFunc: envDefaultFunc("OS_TENANT_NAME"),
}, },
"password": &schema.Schema{ "password": &schema.Schema{
Type: schema.TypeString, Type: schema.TypeString,

View File

@ -8,7 +8,6 @@ import (
"github.com/hashicorp/terraform/terraform" "github.com/hashicorp/terraform/terraform"
) )
var ( var (
OS_REGION_NAME = "" OS_REGION_NAME = ""
) )

View File

@ -36,15 +36,15 @@ func resourceComputeInstanceV2() *schema.Resource {
ForceNew: false, ForceNew: false,
}, },
"image_ref": &schema.Schema{ "image_ref": &schema.Schema{
Type: schema.TypeString, Type: schema.TypeString,
Required: true, Required: true,
ForceNew: false, ForceNew: false,
DefaultFunc: envDefaultFunc("OS_IMAGE_ID"), DefaultFunc: envDefaultFunc("OS_IMAGE_ID"),
}, },
"flavor_ref": &schema.Schema{ "flavor_ref": &schema.Schema{
Type: schema.TypeString, Type: schema.TypeString,
Required: true, Required: true,
ForceNew: false, ForceNew: false,
DefaultFunc: envDefaultFunc("OS_FLAVOR_ID"), DefaultFunc: envDefaultFunc("OS_FLAVOR_ID"),
}, },
"security_groups": &schema.Schema{ "security_groups": &schema.Schema{

View File

@ -73,7 +73,6 @@ func testAccCheckComputeV2InstanceExists(t *testing.T, n string, instance *serve
return fmt.Errorf("(testAccCheckComputeV2InstanceExists) Error creating OpenStack compute client: %s", err) return fmt.Errorf("(testAccCheckComputeV2InstanceExists) Error creating OpenStack compute client: %s", err)
} }
found, err := servers.Get(computeClient, rs.Primary.ID).Extract() found, err := servers.Get(computeClient, rs.Primary.ID).Extract()
if err != nil { if err != nil {
return err return err
@ -120,4 +119,4 @@ var testAccComputeV2Instance_basic = fmt.Sprintf(`
foo = "bar" foo = "bar"
} }
}`, }`,
OS_REGION_NAME) OS_REGION_NAME)

View File

@ -169,7 +169,7 @@ func resourceLBVipV1Read(d *schema.ResourceData, meta interface{}) error {
} }
if t, exists := d.GetOk("persistence"); exists && t != "" { if t, exists := d.GetOk("persistence"); exists && t != "" {
d.Set("persistence", p.Description) d.Set("persistence", p.Description)
} }
if t, exists := d.GetOk("conn_limit"); exists && t != "" { if t, exists := d.GetOk("conn_limit"); exists && t != "" {

View File

@ -20,9 +20,9 @@ func resourceNetworkingNetworkV2() *schema.Resource {
Schema: map[string]*schema.Schema{ Schema: map[string]*schema.Schema{
"region": &schema.Schema{ "region": &schema.Schema{
Type: schema.TypeString, Type: schema.TypeString,
Required: true, Required: true,
ForceNew: true, ForceNew: true,
DefaultFunc: envDefaultFunc("OS_REGION_NAME"), DefaultFunc: envDefaultFunc("OS_REGION_NAME"),
}, },
"name": &schema.Schema{ "name": &schema.Schema{
@ -111,7 +111,7 @@ func resourceNetworkingNetworkV2Read(d *schema.ResourceData, meta interface{}) e
d.Set("region", d.Get("region").(string)) d.Set("region", d.Get("region").(string))
if t, exists := d.GetOk("name"); exists && t != ""{ if t, exists := d.GetOk("name"); exists && t != "" {
d.Set("name", n.Name) d.Set("name", n.Name)
} else { } else {
d.Set("name", "") d.Set("name", "")