Skip to content

Commit

Permalink
Merge pull request Telmate#96 from in0rdr/fix/empty-feature
Browse files Browse the repository at this point in the history
Check feature list length
  • Loading branch information
ggongaware committed Oct 9, 2019
2 parents c05ce12 + a832f0b commit 42a9c68
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions proxmox/resource_lxc.go
Original file line number Diff line number Diff line change
Expand Up @@ -519,8 +519,10 @@ func resourceLxcRead(d *schema.ResourceData, meta interface{}) error {
d.Set("description", config.Description)

defaultFeatures := d.Get("features").(*schema.Set)
featuresWithDefaults := UpdateDeviceConfDefaults(config.Features, defaultFeatures)
d.Set("features", featuresWithDefaults)
if len(defaultFeatures.List()) > 0 {
featuresWithDefaults := UpdateDeviceConfDefaults(config.Features, defaultFeatures)
d.Set("features", featuresWithDefaults)
}

d.Set("force", config.Force)
d.Set("hookscript", config.Hookscript)
Expand Down

0 comments on commit 42a9c68

Please sign in to comment.