From 5ba090c3669dfe1ae7d43b673c89300f75f7cd92 Mon Sep 17 00:00:00 2001 From: Daniel Hokka Zakrisson Date: Mon, 11 Feb 2013 23:23:14 +0100 Subject: [PATCH] Fixes for Python 2.4 --- library/setup | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/library/setup b/library/setup index 8de9ad8d25..82e21da845 100644 --- a/library/setup +++ b/library/setup @@ -435,9 +435,11 @@ class LinuxHardware(Hardware): d['scheduler_mode'] = m.group(2) d['sectors'] = get_file_content(sysdir + "/size") - d['sectors'] = d['sectors'] if d['sectors'] else 0 + if not d['sectors']: + d['sectors'] = 0 d['sectorsize'] = get_file_content(sysdir + "/queue/hw_sector_size") - d['sectorsize'] = d['sectorsize'] if d['sectorsize'] else 512 + if not d['sectorsize']: + d['sectorsize'] = 512 d['size'] = module.pretty_bytes(float(d['sectors']) * float(d['sectorsize'])) d['host'] = ""