Revision 852bbc95
b/lib/uidpool.py | ||
---|---|---|
31 | 31 |
|
32 | 32 |
from ganeti import errors |
33 | 33 |
from ganeti import constants |
34 |
from ganeti import utils |
|
34 | 35 |
|
35 | 36 |
|
36 | 37 |
def ParseUidPool(value, separator=None): |
... | ... | |
108 | 109 |
uid_pool.remove(uid_range) |
109 | 110 |
|
110 | 111 |
|
112 |
def _FormatUidRange(lower, higher): |
|
113 |
"""Convert a user-id range definition into a string. |
|
114 |
|
|
115 |
""" |
|
116 |
if lower == higher: |
|
117 |
return str(lower) |
|
118 |
return "%s-%s" % (lower, higher) |
|
119 |
|
|
120 |
|
|
121 |
def FormatUidPool(uid_pool): |
|
122 |
"""Convert the internal representation of the user-id pool into a string. |
|
123 |
|
|
124 |
The output format is also accepted by ParseUidPool() |
|
125 |
|
|
126 |
@param uid_pool: a list of integer pairs representing UID ranges |
|
127 |
@return: a string with the formatted results |
|
128 |
|
|
129 |
""" |
|
130 |
return utils.CommaJoin([_FormatUidRange(lower, higher) |
|
131 |
for lower, higher in uid_pool]) |
|
132 |
|
|
133 |
|
|
111 | 134 |
def CheckUidPool(uid_pool): |
112 | 135 |
"""Sanity check user-id pool range definition values. |
113 | 136 |
|
b/scripts/gnt-cluster | ||
---|---|---|
276 | 276 |
ToStdout(" - file storage path: %s", result["file_storage_dir"]) |
277 | 277 |
ToStdout(" - maintenance of node health: %s", |
278 | 278 |
result["maintain_node_health"]) |
279 |
ToStdout(" - uid pool: %s", uidpool.FormatUidPool(result["uid_pool"])) |
|
279 | 280 |
|
280 | 281 |
ToStdout("Default instance parameters:") |
281 | 282 |
_PrintGroupedParams(result["beparams"]) |
Also available in: Unified diff