Martin Polednik has uploaded a new change for review. Change subject: ppc64hwinfo: make getHardwareInfoStructure testable ......................................................................
ppc64hwinfo: make getHardwareInfoStructure testable Make the code testable by moving cpuinfo path to argument. Change-Id: I8f7012fbefacf7a8d3a91bc86520c9ac6d82fb09 Signed-off-by: Martin Polednik <[email protected]> --- M lib/vdsm/ppc64HardwareInfo.py 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/47/57747/1 diff --git a/lib/vdsm/ppc64HardwareInfo.py b/lib/vdsm/ppc64HardwareInfo.py index 6aaaf15..9164e2b 100644 --- a/lib/vdsm/ppc64HardwareInfo.py +++ b/lib/vdsm/ppc64HardwareInfo.py @@ -34,12 +34,12 @@ @utils.memoized -def getHardwareInfoStructure(): +def getHardwareInfoStructure(cpuinfo_path='/proc/cpuinfo'): infoStructure = {'systemSerialNumber': 'unavailable', 'systemFamily': 'unavailable', 'systemVersion': 'unavailable'} - with open('/proc/cpuinfo') as info: + with open(cpuinfo_path) as info: for line in info: if line.strip() == '': continue -- To view, visit https://gerrit.ovirt.org/57747 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8f7012fbefacf7a8d3a91bc86520c9ac6d82fb09 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Martin Polednik <[email protected]> _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
