Skip to content

Commit

Permalink
provider/openstack: Don't default 'shared' value, instead only set if…
Browse files Browse the repository at this point in the history
… specified. Fixes #9829
  • Loading branch information
fatmcgav committed Nov 3, 2016
1 parent 6c801d0 commit 7eee726
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ func resourceFWPolicyV1() *schema.Resource {
"shared": &schema.Schema{
Type: schema.TypeBool,
Optional: true,
Default: false,
},
"tenant_id": &schema.Schema{
Type: schema.TypeString,
Expand Down Expand Up @@ -79,17 +78,20 @@ func resourceFWPolicyV1Create(d *schema.ResourceData, meta interface{}) error {
}

audited := d.Get("audited").(bool)
shared := d.Get("shared").(bool)

opts := policies.CreateOpts{
Name: d.Get("name").(string),
Description: d.Get("description").(string),
Audited: &audited,
Shared: &shared,
TenantID: d.Get("tenant_id").(string),
Rules: rules,
}

if r, ok := d.GetOk("shared"); ok {
shared := r.(bool)
opts.Shared = &shared
}

log.Printf("[DEBUG] Create firewall policy: %#v", opts)

policy, err := policies.Create(networkingClient, opts).Extract()
Expand Down

0 comments on commit 7eee726

Please sign in to comment.