Revision 6396164f scripts/gnt-node
b/scripts/gnt-node | ||
---|---|---|
28 | 28 |
|
29 | 29 |
import sys |
30 | 30 |
|
31 |
try: |
|
32 |
import roman |
|
33 |
except ImportError: |
|
34 |
roman = None |
|
35 |
|
|
36 | 31 |
from ganeti.cli import * |
37 | 32 |
from ganeti import opcodes |
38 | 33 |
from ganeti import utils |
39 | 34 |
from ganeti import constants |
35 |
from ganeti import compat |
|
40 | 36 |
from ganeti import errors |
41 | 37 |
from ganeti import bootstrap |
42 | 38 |
|
... | ... | |
232 | 228 |
val = utils.FormatTime(val) |
233 | 229 |
elif val is None: |
234 | 230 |
val = "?" |
235 |
elif (roman is not None and opts.roman_integers |
|
236 |
and field in latinfriendlyfields): |
|
237 |
try: |
|
238 |
val = roman.toRoman(val) |
|
239 |
except roman.RomanError: |
|
240 |
pass |
|
231 |
elif opts.roman_integers and field in latinfriendlyfields: |
|
232 |
val = compat.TryToRoman(val) |
|
241 | 233 |
row[idx] = str(val) |
242 | 234 |
|
243 | 235 |
data = GenerateTable(separator=opts.separator, headers=headers, |
Also available in: Unified diff