Revision 606d909d scripts/gnt-os
b/scripts/gnt-os | ||
---|---|---|
46 | 46 |
oses[node_name] = [obj for obj in result[node_name] |
47 | 47 |
if isinstance(obj, objects.OS)] |
48 | 48 |
|
49 |
# Get intersection of all OSes |
|
49 | 50 |
fnode = oses.keys()[0] |
50 | 51 |
os_set = set([os_inst.name for os_inst in oses[fnode]]) |
51 | 52 |
del oses[fnode] |
52 | 53 |
for node in oses: |
53 | 54 |
os_set &= set([os_inst.name for os_inst in oses[node]]) |
54 | 55 |
|
55 |
format = "%s" |
|
56 |
|
|
57 | 56 |
if not opts.no_headers: |
58 |
logger.ToStdout(format % 'Name') |
|
57 |
headers = {"name": "Name"} |
|
58 |
else: |
|
59 |
headers = None |
|
59 | 60 |
|
60 |
for os_name in os_set:
|
|
61 |
logger.ToStdout(format % os_name)
|
|
61 |
OutputTable(separator=None, headers=headers, fields=["name"],
|
|
62 |
data=[[os] for os in os_set])
|
|
62 | 63 |
|
63 | 64 |
return 0 |
64 | 65 |
|
Also available in: Unified diff