Revision 00fe9e38 lib/rpc.py
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