From ecc28c097660b96c042e9a917426791c55c09310 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 19 Jan 2018 13:58:59 -0500 Subject: [PATCH] Sort the inventory data Iterating through hash keys produced ugly ordering. Improve by sorting on the fruid instead. Change-Id: I4be93261b06804b4fb37e499e8b589ba923f8286 --- pyghmi/ipmi/command.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyghmi/ipmi/command.py b/pyghmi/ipmi/command.py index 9660994e..84c3a2ae 100644 --- a/pyghmi/ipmi/command.py +++ b/pyghmi/ipmi/command.py @@ -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: