Revision 2af8b9c9 lib/client/gnt_instance.py
b/lib/client/gnt_instance.py | ||
---|---|---|
95 | 95 |
# pylint: disable=W0142 |
96 | 96 |
|
97 | 97 |
if client is None: |
98 |
client = GetClient(query=True)
|
|
98 |
client = GetClient() |
|
99 | 99 |
if mode == _EXPAND_CLUSTER: |
100 | 100 |
if names: |
101 | 101 |
raise errors.OpPrereqError("Cluster filter mode takes no arguments", |
... | ... | |
182 | 182 |
if opts.multi_mode is None: |
183 | 183 |
opts.multi_mode = _EXPAND_INSTANCES |
184 | 184 |
cl = GetClient() |
185 |
qcl = GetClient(query=True) |
|
186 |
inames = _ExpandMultiNames(opts.multi_mode, args, client=qcl) |
|
185 |
inames = _ExpandMultiNames(opts.multi_mode, args, client=cl) |
|
187 | 186 |
if not inames: |
188 | 187 |
if opts.multi_mode == _EXPAND_CLUSTER: |
189 | 188 |
ToStdout("Cluster is empty, no instances to shutdown") |
... | ... | |
224 | 223 |
for item in value), |
225 | 224 |
False)) |
226 | 225 |
|
227 |
cl = GetClient(query=True)
|
|
226 |
cl = GetClient() |
|
228 | 227 |
|
229 | 228 |
return GenericList(constants.QR_INSTANCE, selected_fields, args, opts.units, |
230 | 229 |
opts.separator, not opts.no_headers, |
... | ... | |
422 | 421 |
instance_name = args[0] |
423 | 422 |
force = opts.force |
424 | 423 |
cl = GetClient() |
425 |
qcl = GetClient(query=True) |
|
426 | 424 |
|
427 | 425 |
if not force: |
428 |
_EnsureInstancesExist(qcl, [instance_name])
|
|
426 |
_EnsureInstancesExist(cl, [instance_name]) |
|
429 | 427 |
|
430 | 428 |
usertext = ("This will remove the volumes of the instance %s" |
431 | 429 |
" (including mirrors), thus removing all the data" |
... | ... | |
855 | 853 |
instance_name = args[0] |
856 | 854 |
|
857 | 855 |
cl = GetClient() |
858 |
qcl = GetClient(query=True) |
|
859 | 856 |
try: |
860 | 857 |
cluster_name = cl.QueryConfigValues(["cluster_name"])[0] |
861 | 858 |
((console_data, oper_state), ) = \ |
862 |
qcl.QueryInstances([instance_name], ["console", "oper_state"], False)
|
|
859 |
cl.QueryInstances([instance_name], ["console", "oper_state"], False) |
|
863 | 860 |
finally: |
864 | 861 |
# Ensure client connection is closed while external commands are run |
865 | 862 |
cl.Close() |
866 |
qcl.Close() |
|
867 | 863 |
|
868 | 864 |
del cl |
869 |
del qcl |
|
870 | 865 |
|
871 | 866 |
if not console_data: |
872 | 867 |
if oper_state: |
Also available in: Unified diff