change "macaddr" to behave like original "mac"

This commit is contained in:
Grant Gongaware 2019-03-07 08:04:45 -08:00
parent 414c2fc749
commit bf98b941f7

View File

@ -91,7 +91,13 @@ func resourceVmQemu() *schema.Resource {
"macaddr": &schema.Schema{
// TODO: Find a way to set MAC address in .tf config.
Type: schema.TypeString,
Computed: true,
Optional: true,
DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool {
if new == "" {
return true // macaddr auto-generates and its ok
}
return strings.TrimSpace(old) == strings.TrimSpace(new)
},
},
"bridge": &schema.Schema{
Type: schema.TypeString,