Revision 83d92ad8
b/daemons/ganeti-noded | ||
---|---|---|
608 | 608 |
"""Query detailed information about existing OSes. |
609 | 609 |
|
610 | 610 |
""" |
611 |
return [os_obj.ToDict() for os_obj in backend.DiagnoseOS()] |
|
611 |
return True, [os_obj.ToDict() for os_obj in backend.DiagnoseOS()]
|
|
612 | 612 |
|
613 | 613 |
@staticmethod |
614 | 614 |
def perspective_os_get(params): |
b/lib/cmdlib.py | ||
---|---|---|
1811 | 1811 |
# level), so that nodes with a non-responding node daemon don't |
1812 | 1812 |
# make all OSes invalid |
1813 | 1813 |
good_nodes = [node_name for node_name in rlist |
1814 |
if not rlist[node_name].failed]
|
|
1815 |
for node_name, nr in rlist.iteritems():
|
|
1816 |
if nr.failed or not nr.data:
|
|
1814 |
if not rlist[node_name].RemoteFailMsg()]
|
|
1815 |
for node_name, nr in rlist.items(): |
|
1816 |
if nr.RemoteFailMsg() or not nr.payload:
|
|
1817 | 1817 |
continue |
1818 |
for os_obj in nr.data: |
|
1818 |
for os_serialized in nr.payload: |
|
1819 |
os_obj = objects.OS.FromDict(os_serialized) |
|
1819 | 1820 |
if os_obj.name not in all_os: |
1820 | 1821 |
# build a list of nodes for this os containing empty lists |
1821 | 1822 |
# for each node in node_list |
... | ... | |
1831 | 1832 |
""" |
1832 | 1833 |
valid_nodes = [node for node in self.cfg.GetOnlineNodeList()] |
1833 | 1834 |
node_data = self.rpc.call_os_diagnose(valid_nodes) |
1834 |
if node_data == False: |
|
1835 |
raise errors.OpExecError("Can't gather the list of OSes") |
|
1836 | 1835 |
pol = self._DiagnoseByOS(valid_nodes, node_data) |
1837 | 1836 |
output = [] |
1838 |
for os_name, os_data in pol.iteritems():
|
|
1837 |
for os_name, os_data in pol.items(): |
|
1839 | 1838 |
row = [] |
1840 | 1839 |
for field in self.op.output_fields: |
1841 | 1840 |
if field == "name": |
b/lib/rpc.py | ||
---|---|---|
864 | 864 |
This is a multi-node call. |
865 | 865 |
|
866 | 866 |
""" |
867 |
result = self._MultiNodeCall(node_list, "os_diagnose", []) |
|
868 |
|
|
869 |
for node_result in result.values(): |
|
870 |
if not node_result.failed and node_result.data: |
|
871 |
node_result.data = [objects.OS.FromDict(oss) |
|
872 |
for oss in node_result.data] |
|
873 |
return result |
|
867 |
return self._MultiNodeCall(node_list, "os_diagnose", []) |
|
874 | 868 |
|
875 | 869 |
def call_os_get(self, node, name): |
876 | 870 |
"""Returns an OS definition. |
Also available in: Unified diff