Revision 00fe9e38
b/lib/cmdlib.py | ||
---|---|---|
2158 | 2158 |
if pnode is None: |
2159 | 2159 |
raise errors.OpPrereqError("Primary node '%s' is unknown" % |
2160 | 2160 |
self.op.pnode) |
2161 |
os_obj = rpc.call_os_get([pnode.name], self.op.os_type)[pnode.name]
|
|
2161 |
os_obj = rpc.call_os_get(pnode.name, self.op.os_type)
|
|
2162 | 2162 |
if not isinstance(os_obj, objects.OS): |
2163 | 2163 |
raise errors.OpPrereqError("OS '%s' not in supported OS list for" |
2164 | 2164 |
" primary node" % self.op.os_type) |
... | ... | |
2949 | 2949 |
(node, info['vg_free'], req_size)) |
2950 | 2950 |
|
2951 | 2951 |
# os verification |
2952 |
os_obj = rpc.call_os_get([pnode.name], self.op.os_type)[pnode.name]
|
|
2952 |
os_obj = rpc.call_os_get(pnode.name, self.op.os_type)
|
|
2953 | 2953 |
if not isinstance(os_obj, objects.OS): |
2954 | 2954 |
raise errors.OpPrereqError("OS '%s' not in supported os list for" |
2955 | 2955 |
" primary node" % self.op.os_type) |
b/lib/rpc.py | ||
---|---|---|
653 | 653 |
return new_result |
654 | 654 |
|
655 | 655 |
|
656 |
def call_os_get(node_list, name):
|
|
656 |
def call_os_get(node, name): |
|
657 | 657 |
"""Returns an OS definition. |
658 | 658 |
|
659 |
This is a multi-node call.
|
|
659 |
This is a single-node call.
|
|
660 | 660 |
|
661 | 661 |
""" |
662 | 662 |
c = Client("os_get", [name]) |
663 |
c.connect_list(node_list)
|
|
663 |
c.connect(node)
|
|
664 | 664 |
c.run() |
665 |
result = c.getresult() |
|
666 |
new_result = {} |
|
667 |
for node_name in result: |
|
668 |
data = result[node_name] |
|
669 |
if isinstance(data, dict): |
|
670 |
new_result[node_name] = objects.OS.FromDict(data) |
|
671 |
elif isinstance(data, tuple) and len(data) == 3: |
|
672 |
new_result[node_name] = errors.InvalidOS(data[0], data[1], data[2]) |
|
673 |
else: |
|
674 |
new_result[node_name] = data |
|
665 |
result = c.getresult().get(node, False) |
|
666 |
|
|
667 |
if isinstance(result, dict): |
|
668 |
new_result = objects.OS.FromDict(result) |
|
669 |
elif isinstance(result, tuple) and len(data) == 3: |
|
670 |
new_result = errors.InvalidOS(result[0], result[1], result[2]) |
|
671 |
else: |
|
672 |
new_result = result |
|
673 |
|
|
675 | 674 |
return new_result |
676 | 675 |
|
677 | 676 |
|
Also available in: Unified diff