Revision 4e679f11 daemons/ganeti-noded
b/daemons/ganeti-noded | ||
---|---|---|
451 | 451 |
"""Query detailed information about existing OSes. |
452 | 452 |
|
453 | 453 |
""" |
454 |
os_list = backend.DiagnoseOS() |
|
455 |
if not os_list: |
|
456 |
# this catches also return values of 'False', |
|
457 |
# for which we can't iterate over |
|
458 |
return os_list |
|
459 |
result = [] |
|
460 |
for data in os_list: |
|
461 |
if isinstance(data, objects.OS): |
|
462 |
result.append(data.ToDict()) |
|
463 |
elif isinstance(data, errors.InvalidOS): |
|
464 |
result.append(data.args) |
|
465 |
else: |
|
466 |
raise errors.ProgrammerError("Invalid result from backend.DiagnoseOS" |
|
467 |
" (class %s, %s)" % |
|
468 |
(str(data.__class__), data)) |
|
469 |
|
|
470 |
return result |
|
454 |
return [os.ToDict() for os in backend.DiagnoseOS()] |
|
471 | 455 |
|
472 | 456 |
@staticmethod |
473 | 457 |
def perspective_os_get(params): |
Also available in: Unified diff