Revision cc0451f3 scripts/gnt-os
b/scripts/gnt-os | ||
---|---|---|
45 | 45 |
elif isinstance(obj, errors.InvalidOS): |
46 | 46 |
return False |
47 | 47 |
else: |
48 |
raise errors.ProgrammerError('unknown OS diagnose type')
|
|
48 |
raise errors.ProgrammerError("unknown OS diagnose type: '%s'" % type(obj))
|
|
49 | 49 |
|
50 | 50 |
|
51 | 51 |
def _DiagnoseOSName(obj): |
... | ... | |
126 | 126 |
for os_name, os_node_data in all_os.iteritems(): |
127 | 127 |
if len(os_node_data) != num_nodes: |
128 | 128 |
continue |
129 |
valid = True |
|
130 |
for l in os_node_data.values(): |
|
131 |
if not _DiagnoseOSValid(l[0]): |
|
132 |
valid = False |
|
133 |
break |
|
134 |
if valid: |
|
129 |
|
|
130 |
if utils.all(os_node_data.values(), lambda l: _DiagnoseOSValid(l[0])): |
|
135 | 131 |
valid_os.append(os_name) |
136 | 132 |
|
137 | 133 |
if not opts.no_headers: |
Also available in: Unified diff