Skip to content

Commit

Permalink
Sorted devices since sometimes they are not
Browse files Browse the repository at this point in the history
  • Loading branch information
muresan committed Nov 19, 2023
1 parent c355736 commit 95024d9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libvirt/data_source_libvirt_node_devices.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package libvirt
import (
"fmt"
"log"
"sort"
"strconv"

libvirt "github.com/digitalocean/go-libvirt"
Expand Down Expand Up @@ -64,6 +65,7 @@ func resourceLibvirtNodeDevicesRead(d *schema.ResourceData, meta interface{}) er
return fmt.Errorf("failed to retrieve list of node devices: %w", err)
}

sort.Strings(devices)
d.Set("devices", devices)
d.SetId(strconv.Itoa(hashcode.String(fmt.Sprintf("%v", devices))))

Expand Down

0 comments on commit 95024d9

Please sign in to comment.