provider/consul: Change keyword to key from keys

This commit is contained in:
Armon Dadgar 2014-10-20 12:02:48 -07:00
parent 3e43eb5497
commit 3fcc016e48
1 changed files with 6 additions and 6 deletions

View File

@ -31,7 +31,7 @@ func resourceConsulKeys() *schema.Resource {
Optional: true, Optional: true,
}, },
"keys": &schema.Schema{ "key": &schema.Schema{
Type: schema.TypeSet, Type: schema.TypeSet,
Optional: true, Optional: true,
Elem: &schema.Resource{ Elem: &schema.Resource{
@ -113,7 +113,7 @@ func resourceConsulKeysCreate(d *schema.ResourceData, meta interface{}) error {
vars := make(map[string]string) vars := make(map[string]string)
// Extract the keys // Extract the keys
keys := d.Get("keys").(*schema.Set).List() keys := d.Get("key").(*schema.Set).List()
for _, raw := range keys { for _, raw := range keys {
key, path, sub, err := parse_key(raw) key, path, sub, err := parse_key(raw)
if err != nil { if err != nil {
@ -149,7 +149,7 @@ func resourceConsulKeysCreate(d *schema.ResourceData, meta interface{}) error {
// Update the resource // Update the resource
d.SetId("consul") d.SetId("consul")
d.Set("datacenter", dc) d.Set("datacenter", dc)
d.Set("keys", keys) d.Set("key", keys)
d.Set("var", vars) d.Set("var", vars)
return nil return nil
} }
@ -178,7 +178,7 @@ func resourceConsulKeysRead(d *schema.ResourceData, meta interface{}) error {
vars := make(map[string]string) vars := make(map[string]string)
// Extract the keys // Extract the keys
keys := d.Get("keys").(*schema.Set).List() keys := d.Get("key").(*schema.Set).List()
for _, raw := range keys { for _, raw := range keys {
key, path, sub, err := parse_key(raw) key, path, sub, err := parse_key(raw)
if err != nil { if err != nil {
@ -197,7 +197,7 @@ func resourceConsulKeysRead(d *schema.ResourceData, meta interface{}) error {
} }
// Update the resource // Update the resource
d.Set("keys", keys) d.Set("key", keys)
d.Set("var", vars) d.Set("var", vars)
return nil return nil
} }
@ -223,7 +223,7 @@ func resourceConsulKeysDelete(d *schema.ResourceData, meta interface{}) error {
wOpts := consulapi.WriteOptions{Datacenter: dc, Token: token} wOpts := consulapi.WriteOptions{Datacenter: dc, Token: token}
// Extract the keys // Extract the keys
keys := d.Get("keys").(*schema.Set).List() keys := d.Get("key").(*schema.Set).List()
for _, raw := range keys { for _, raw := range keys {
_, path, sub, err := parse_key(raw) _, path, sub, err := parse_key(raw)
if err != nil { if err != nil {