providers/heroku: set all the things

This commit is contained in:
Mitchell Hashimoto 2014-10-14 12:18:18 -07:00
parent e4a2cb216c
commit 3e6263332d
1 changed files with 9 additions and 9 deletions

View File

@ -118,17 +118,17 @@ func resourceHerokuAppCreate(d *schema.ResourceData, meta interface{}) error {
// Build up our creation options
opts := heroku.AppCreateOpts{}
if v := d.Get("name"); v != nil {
if v, ok := d.GetOk("name"); ok {
vs := v.(string)
log.Printf("[DEBUG] App name: %s", vs)
opts.Name = &vs
}
if v := d.Get("region"); v != nil {
if v, ok := d.GetOk("region"); ok {
vs := v.(string)
log.Printf("[DEBUG] App region: %s", vs)
opts.Region = &vs
}
if v := d.Get("stack"); v != nil {
if v, ok := d.GetOk("stack"); ok {
vs := v.(string)
log.Printf("[DEBUG] App stack: %s", vs)
opts.Stack = &vs
@ -143,7 +143,7 @@ func resourceHerokuAppCreate(d *schema.ResourceData, meta interface{}) error {
d.SetId(a.Name)
log.Printf("[INFO] App ID: %s", d.Id())
if v := d.Get("config_vars"); v != nil {
if v, ok := d.GetOk("config_vars"); ok {
err = update_config_vars(d.Id(), client, nil, v.([]interface{}))
if err != nil {
return err
@ -157,22 +157,22 @@ func resourceHerokuOrgAppCreate(d *schema.ResourceData, meta interface{}) error
client := meta.(*heroku.Service)
// Build up our creation options
opts := heroku.OrganizationAppCreateOpts{}
if v := d.Get("organization"); v != nil {
if v, ok := d.GetOk("organization"); ok {
vs := v.(string)
log.Printf("[DEBUG] App name: %s", vs)
opts.Organization = &vs
}
if v := d.Get("name"); v != nil {
if v, ok := d.GetOk("name"); ok {
vs := v.(string)
log.Printf("[DEBUG] App name: %s", vs)
opts.Name = &vs
}
if v := d.Get("region"); v != nil {
if v, ok := d.GetOk("region"); ok {
vs := v.(string)
log.Printf("[DEBUG] App region: %s", vs)
opts.Region = &vs
}
if v := d.Get("stack"); v != nil {
if v, ok := d.GetOk("stack"); ok {
vs := v.(string)
log.Printf("[DEBUG] App stack: %s", vs)
opts.Stack = &vs
@ -187,7 +187,7 @@ func resourceHerokuOrgAppCreate(d *schema.ResourceData, meta interface{}) error
d.SetId(a.Name)
log.Printf("[INFO] App ID: %s", d.Id())
if v := d.Get("config_vars"); v != nil {
if v, ok := d.GetOk("config_vars"); ok {
err = update_config_vars(d.Id(), client, nil, v.([]interface{}))
if err != nil {
return err