Skip to content

Commit

Permalink
Fix location references
Browse files Browse the repository at this point in the history
Some Location properties were defined as strings, but these should
contain a Location structure.

Closes stmcginnis#61

Signed-off-by: Sean McGinnis <[email protected]>
  • Loading branch information
stmcginnis committed May 20, 2020
1 parent 1b79138 commit 1e0f2db
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 7 deletions.
7 changes: 6 additions & 1 deletion redfish/drive_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,12 @@ var driveBody = strings.NewReader(
"NegotiatedSpeedGbps": 10,
"Operations": [],
"PartNumber": "12345",
"PhysicalLocation": {},
"PhysicalLocation": {
"PartLocation": {
"LocationOrdinalValue": 0,
"LocationType": "Slot"
}
},
"PredictedMediaLifeLeftPercent": 100,
"Protocol": "FC",
"Revision": "2.0",
Expand Down
2 changes: 1 addition & 1 deletion redfish/memory.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ type Memory struct {
// IsSpareDeviceEnabled shall be true if a spare device is enabled for this Memory.
IsSpareDeviceEnabled bool
// Location shall contain location information of the associated memory.
Location string
Location common.Location
// LogicalSizeMiB shall be the total size of the logical memory in MiB.
LogicalSizeMiB int
// Manufacturer shall contain a string which identifies the manufacturer of the Memory.
Expand Down
7 changes: 7 additions & 0 deletions redfish/memory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ var memoryBody = strings.NewReader(
"FirmwareRevision": "3",
"IsRankSpareEnabled": false,
"IsSpareDeviceEnabled": false,
"Location": {
"PartLocation": {
"LocationType": "Slot",
"ServiceLabel": "DIMM 5",
"LocationOrdinalValue": 4
}
},
"LogicalSizeMiB": 2097152,
"Manufacturer": "Generic",
"MemoryDeviceType": "DDR4",
Expand Down
4 changes: 2 additions & 2 deletions redfish/networkadapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ type Controllers struct {
// firmware package.
FirmwarePackageVersion string
// Location shall contain location information of the associated network
// adapter controller. TODO: Needs to be a Location struct.
//Location string
// adapter controller.
Location common.Location
// PCIeInterface is used to connect this PCIe-based controller to its host.
PCIeInterface PCIeInterface
// NetworkDeviceFunctions shall be an array of references of type
Expand Down
4 changes: 2 additions & 2 deletions redfish/power.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,8 @@ type PowerSupply struct {
// line voltage supported by the associated power supply.
LineInputVoltageType LineInputVoltageType
// Location shall contain location information of the
// associated power supply. TODO: Make Location object.
//Location string
// associated power supply.
Location common.Location
// Manufacturer shall be the name of the
// organization responsible for producing the power supply. This
// organization might be the entity from whom the power supply is
Expand Down
2 changes: 1 addition & 1 deletion redfish/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ type Processor struct {
Links string
// Location shall contain location information of the
// associated processor.
Location string
Location common.Location
// Manufacturer shall contain a string which identifies
// the manufacturer of the processor.
Manufacturer string
Expand Down

0 comments on commit 1e0f2db

Please sign in to comment.