2
0
mirror of https://opendev.org/x/pyghmi synced 2025-01-14 11:48:33 +00:00

Sort the inventory data

Iterating through hash keys produced ugly ordering.  Improve by
sorting on the fruid instead.

Change-Id: I4be93261b06804b4fb37e499e8b589ba923f8286
This commit is contained in:
Jarrod Johnson 2018-01-19 13:58:59 -05:00
parent d33aeb321c
commit ecc28c0976

View File

@ -555,7 +555,7 @@ class Command(object):
yield "System"
if self._sdr is None:
self._sdr = sdr.SDR(self)
for fruid in self._sdr.fru:
for fruid in sorted(self._sdr.fru):
yield self._sdr.fru[fruid].fru_name
self.oem_init()
for compname in self._oem.get_oem_inventory_descriptions():
@ -616,7 +616,7 @@ class Command(object):
yield ("System", self._get_zero_fru())
if self._sdr is None:
self._sdr = sdr.SDR(self)
for fruid in self._sdr.fru:
for fruid in sorted(self._sdr.fru):
fruinf = fru.FRU(
ipmicmd=self, fruid=fruid, sdr=self._sdr.fru[fruid]).info
if fruinf is not None: