summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2010-05-10 18:31:56 -0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2010-05-10 18:31:56 -0300
commit6d0288b6c0afa5d92701f1f1f9b677fafd1968cd (patch)
tree9e9ac18db0c900bad5cc32bd8837c40979ad15f0
parent7210b5390137323a18ca6eeda00aa73318f743f9 (diff)
downloadtuna-6d0288b6c0afa5d92701f1f1f9b677fafd1968cd.tar.gz
tuna: Make cpustring_to_list understand 0x prefixed hexadecimal numbers
Needed to really fix https://bugzilla.redhat.com/show_bug.cgi?id=574950 Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rwxr-xr-xtuna/tuna.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tuna/tuna.py b/tuna/tuna.py
index 8a95ae2..f5184fb 100755
--- a/tuna/tuna.py
+++ b/tuna/tuna.py
@@ -97,13 +97,13 @@ def cpustring_to_list(cpustr):
fields = cpustr.strip().split(",")
cpu_list = []
for field in fields:
- ends = field.split("-")
+ ends = [ int(a, 0) for a in field.split("-") ]
if len(ends) > 2:
raise "Syntax error"
if len(ends) == 2:
- cpu_list += range(int(ends[0]), int(ends[1])+1)
+ cpu_list += range(ends[0], ends[1] + 1)
else:
- cpu_list += [int(ends[0])]
+ cpu_list += [ends[0]]
return list(set(cpu_list))
def list_to_cpustring(l):