Commit 23f1bf29 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

uidpool: Remove roman number support

Doing so simplifies to code a bit and never had a practical use.
Signed-off-by: default avatarMichael Hanselmann <>
Reviewed-by: default avatarGuido Trotter <>
parent 3e3ddbf0
......@@ -447,9 +447,7 @@ def ShowClusterConfig(opts, args):
ToStdout(" - maintenance of node health: %s",
ToStdout(" - uid pool: %s",
ToStdout(" - uid pool: %s", uidpool.FormatUidPool(result["uid_pool"]))
ToStdout(" - default instance allocator: %s", result["default_iallocator"])
ToStdout(" - primary ip version: %d", result["primary_ip_version"])
ToStdout(" - preallocation wipe disks: %s", result["prealloc_wipe_disks"])
......@@ -36,7 +36,6 @@ import random
from ganeti import errors
from ganeti import constants
from ganeti import compat
from ganeti import utils
from ganeti import pathutils
......@@ -116,17 +115,17 @@ def RemoveFromUidPool(uid_pool, remove_uids):
def _FormatUidRange(lower, higher, roman=False):
def _FormatUidRange(lower, higher):
"""Convert a user-id range definition into a string.
if lower == higher:
return str(compat.TryToRoman(lower, convert=roman))
return "%s-%s" % (compat.TryToRoman(lower, convert=roman),
compat.TryToRoman(higher, convert=roman))
return str(lower)
return "%s-%s" % (lower, higher)
def FormatUidPool(uid_pool, separator=None, roman=False):
def FormatUidPool(uid_pool, separator=None):
"""Convert the internal representation of the user-id pool into a string.
The output format is also accepted by ParseUidPool()
......@@ -139,7 +138,7 @@ def FormatUidPool(uid_pool, separator=None, roman=False):
if separator is None:
separator = ", "
return separator.join([_FormatUidRange(lower, higher, roman=roman)
return separator.join([_FormatUidRange(lower, higher)
for lower, higher in uid_pool])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment