Revision b7329c9c scripts/gnt-instance
b/scripts/gnt-instance | ||
---|---|---|
69 | 69 |
if mode == _SHUTDOWN_CLUSTER: |
70 | 70 |
if names: |
71 | 71 |
raise errors.OpPrereqError("Cluster filter mode takes no arguments") |
72 |
op = opcodes.OpQueryInstances(output_fields=["name"], names=[])
|
|
73 |
idata = SubmitOpCode(op)
|
|
72 |
client = GetClient()
|
|
73 |
idata = client.QueryInstances([], ["name"])
|
|
74 | 74 |
inames = [row[0] for row in idata] |
75 | 75 |
|
76 | 76 |
elif mode in (_SHUTDOWN_NODES_BOTH, |
... | ... | |
78 | 78 |
_SHUTDOWN_NODES_SEC): |
79 | 79 |
if not names: |
80 | 80 |
raise errors.OpPrereqError("No node names passed") |
81 |
op = opcodes.OpQueryNodes(output_fields=["name", "pinst_list", |
|
82 |
"sinst_list"], names=names) |
|
83 |
ndata = SubmitOpCode(op) |
|
81 |
client = GetClient() |
|
82 |
ndata = client.QueryNodes(names, ["name", "pinst_list", "sinst_list"]) |
|
84 | 83 |
ipri = [row[1] for row in ndata] |
85 | 84 |
pri_names = list(itertools.chain(*ipri)) |
86 | 85 |
isec = [row[2] for row in ndata] |
... | ... | |
97 | 96 |
elif mode == _SHUTDOWN_INSTANCES: |
98 | 97 |
if not names: |
99 | 98 |
raise errors.OpPrereqError("No instance names passed") |
100 |
op = opcodes.OpQueryInstances(output_fields=["name"], names=names)
|
|
101 |
idata = SubmitOpCode(op)
|
|
99 |
client = GetClient()
|
|
100 |
idata = client.QueryInstances(names, ["name"])
|
|
102 | 101 |
inames = [row[0] for row in idata] |
103 | 102 |
|
104 | 103 |
else: |
Also available in: Unified diff