aboutsummaryrefslogtreecommitdiff
path: root/libvirt
diff options
context:
space:
mode:
authorDuncan Mac-Vicar P <dmacvicar@suse.de>2017-11-24 17:09:50 +0100
committerDuncan Mac-Vicar P <dmacvicar@suse.de>2017-11-24 17:56:45 +0100
commit4fea0870bf634945d4b1f101e49d1193651600b3 (patch)
tree524d60015caa37fd183a979676d819630562bdd8 /libvirt
parent1f6b7508dac80715b794bdd1ab17e8f6141c404d (diff)
downloadterraform-provider-libvirt-4fea0870bf634945d4b1f101e49d1193651600b3.tar
terraform-provider-libvirt-4fea0870bf634945d4b1f101e49d1193651600b3.tar.gz
Remove intermediate variables in map iteration
Diffstat (limited to 'libvirt')
-rw-r--r--libvirt/resource_libvirt_domain.go4
1 files changed, 1 insertions, 3 deletions
diff --git a/libvirt/resource_libvirt_domain.go b/libvirt/resource_libvirt_domain.go
index 16b618e2..b5d0fb6d 100644
--- a/libvirt/resource_libvirt_domain.go
+++ b/libvirt/resource_libvirt_domain.go
@@ -298,9 +298,7 @@ func resourceLibvirtDomainCreate(d *schema.ResourceData, meta interface{}) error
var cmdlineArgs []string
for i := 0; i < d.Get("cmdline.#").(int); i++ {
- cmdlineKey := fmt.Sprintf("cmdline.%d", i)
- cmdlineMap := d.Get(cmdlineKey).(map[string]interface{})
- for k, v := range cmdlineMap {
+ for k, v := range d.Get(fmt.Sprintf("cmdline.%d", i)).(map[string]interface{}) {
cmdlineArgs = append(cmdlineArgs, fmt.Sprintf("%s=%v", k, v))
}
}