from ganeti import errors
from ganeti import constants
-from ganeti import compat
from ganeti import utils
from ganeti import pathutils
if uid_range not in uid_pool:
raise errors.OpPrereqError(
"User-id range to be removed is not found in the current"
- " user-id pool: %s" % uid_range, errors.ECODE_INVAL)
+ " user-id pool: %s" % str(uid_range), errors.ECODE_INVAL)
uid_pool.remove(uid_range)
-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()
"""
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])