From ab726e449c9cde9f3a61e48709d8561b3077e251 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Mon, 22 Oct 2007 17:41:04 -0400 Subject: [PATCH] Use standard units. svn path=/trunk/web/; revision=211 --- templates/info.tmpl | 4 ++-- templates/main.py | 4 ++-- templates/validation.py | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/templates/info.tmpl b/templates/info.tmpl index 8baeab7..c84e8eb 100644 --- a/templates/info.tmpl +++ b/templates/info.tmpl @@ -75,9 +75,9 @@ $errorRow('hostname', $err) #if not $on Machine Name: $errorRow('name', $err) - Ram:MB (max $max_mem) + Ram:MiB (max $max_mem) $errorRow('memory', $err) - Disk:GB (max $max_disk)WARNING: Modifying disk size may corrupt your data. + Disk:GiB (max $max_disk)WARNING: Modifying disk size may corrupt your data. $errorRow('disk', $err) #else $errorRow('name', $err) diff --git a/templates/main.py b/templates/main.py index ab70cdd..cc8c3d8 100755 --- a/templates/main.py +++ b/templates/main.py @@ -286,7 +286,7 @@ def getDiskInfo(data_dict, machine): name = disk.guest_device_name disk_fields.extend([(x % name, y % name) for x, y in disk_fields_template]) - data_dict['%s_size' % name] = "%0.1f GB" % (disk.size / 1024.) + data_dict['%s_size' % name] = "%0.1f GiB" % (disk.size / 1024.) return disk_fields def command(user, fields): @@ -496,7 +496,7 @@ def infoDict(user, machine): display_fields = (display_fields[:disk_point] + disk_fields + display_fields[disk_point+1:]) - main_status['memory'] += ' MB' + main_status['memory'] += ' MiB' for field, disp in display_fields: if field in ('uptime', 'cputime') and locals()[field] is not None: fields.append((disp, locals()[field])) diff --git a/templates/validation.py b/templates/validation.py index 7c0c3da..005925c 100644 --- a/templates/validation.py +++ b/templates/validation.py @@ -109,10 +109,10 @@ def validMemory(user, memory, machine=None, on=True): raise ValueError except ValueError: raise InvalidInput('memory', memory, - "Minimum %s MB" % MIN_MEMORY_SINGLE) + "Minimum %s MiB" % MIN_MEMORY_SINGLE) if memory > maxMemory(user, machine, on): raise InvalidInput('memory', memory, - 'Maximum %s MB' % maxMemory(user, machine)) + 'Maximum %s MiB' % maxMemory(user, machine)) return memory def validDisk(user, disk, machine=None): @@ -127,7 +127,7 @@ def validDisk(user, disk, machine=None): raise ValueError except ValueError: raise InvalidInput('disk', disk, - "Minimum %s GB" % MIN_DISK_SINGLE) + "Minimum %s GiB" % MIN_DISK_SINGLE) return disk def testMachineId(user, machine_id, exists=True): -- 1.7.9.5