fix refactor
This commit is contained in:
parent
c91f54f506
commit
a0399ed326
@ -45,14 +45,14 @@ func (pve ProxmoxClient) Version() (proxmox.Version, error) {
|
|||||||
// Gets and returns a Node's CPU, memory, swap, and Hardware (PCI) resources
|
// Gets and returns a Node's CPU, memory, swap, and Hardware (PCI) resources
|
||||||
func (pve ProxmoxClient) Node(nodeName string) (Host, error) {
|
func (pve ProxmoxClient) Node(nodeName string) (Host, error) {
|
||||||
host := Host{}
|
host := Host{}
|
||||||
host.Hardware = make(map[string]PVEDevice)
|
host.Hardware = make(map[string]Device)
|
||||||
|
|
||||||
node, err := pve.client.Node(context.Background(), nodeName)
|
node, err := pve.client.Node(context.Background(), nodeName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return host, err
|
return host, err
|
||||||
}
|
}
|
||||||
|
|
||||||
devices := []PVEDevice{}
|
devices := []Device{}
|
||||||
err = pve.client.Get(context.Background(), fmt.Sprintf("/nodes/%s/hardware/pci", nodeName), &devices)
|
err = pve.client.Get(context.Background(), fmt.Sprintf("/nodes/%s/hardware/pci", nodeName), &devices)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return host, err
|
return host, err
|
||||||
|
Loading…
x
Reference in New Issue
Block a user