Revision dfa96ded
b/daemons/ganeti-noded | ||
---|---|---|
460 | 460 |
""" |
461 | 461 |
name = params[0] |
462 | 462 |
try: |
463 |
os_obj = backend.OSFromDisk(name).ToDict()
|
|
463 |
os_obj = backend.OSFromDisk(name) |
|
464 | 464 |
except errors.InvalidOS, err: |
465 |
os_obj = err.args
|
|
466 |
return os_obj |
|
465 |
os_obj = objects.OS.FromInvalidOS(err)
|
|
466 |
return os_obj.ToDict()
|
|
467 | 467 |
|
468 | 468 |
# hooks ----------------------- |
469 | 469 |
|
b/lib/cmdlib.py | ||
---|---|---|
2159 | 2159 |
raise errors.OpPrereqError("Primary node '%s' is unknown" % |
2160 | 2160 |
self.op.pnode) |
2161 | 2161 |
os_obj = rpc.call_os_get(pnode.name, self.op.os_type) |
2162 |
if not isinstance(os_obj, objects.OS):
|
|
2162 |
if not os_obj:
|
|
2163 | 2163 |
raise errors.OpPrereqError("OS '%s' not in supported OS list for" |
2164 | 2164 |
" primary node" % self.op.os_type) |
2165 | 2165 |
|
... | ... | |
2950 | 2950 |
|
2951 | 2951 |
# os verification |
2952 | 2952 |
os_obj = rpc.call_os_get(pnode.name, self.op.os_type) |
2953 |
if not isinstance(os_obj, objects.OS):
|
|
2953 |
if not os_obj:
|
|
2954 | 2954 |
raise errors.OpPrereqError("OS '%s' not in supported os list for" |
2955 | 2955 |
" primary node" % self.op.os_type) |
2956 | 2956 |
|
b/lib/rpc.py | ||
---|---|---|
656 | 656 |
c.connect(node) |
657 | 657 |
c.run() |
658 | 658 |
result = c.getresult().get(node, False) |
659 |
|
|
660 | 659 |
if isinstance(result, dict): |
661 |
new_result = objects.OS.FromDict(result) |
|
662 |
elif isinstance(result, tuple) and len(data) == 3: |
|
663 |
new_result = errors.InvalidOS(result[0], result[1], result[2]) |
|
660 |
return objects.OS.FromDict(result) |
|
664 | 661 |
else: |
665 |
new_result = result |
|
666 |
|
|
667 |
return new_result |
|
662 |
return result |
|
668 | 663 |
|
669 | 664 |
|
670 | 665 |
def call_hooks_runner(node_list, hpath, phase, env): |
Also available in: Unified diff