Revision ec79568d lib/cmdlib.py
b/lib/cmdlib.py | ||
---|---|---|
3074 | 3074 |
"""Logical unit for querying instances. |
3075 | 3075 |
|
3076 | 3076 |
""" |
3077 |
_OP_REQP = ["output_fields", "names"] |
|
3077 |
_OP_REQP = ["output_fields", "names", "use_locking"]
|
|
3078 | 3078 |
REQ_BGL = False |
3079 | 3079 |
_FIELDS_STATIC = utils.FieldSet(*["name", "os", "pnode", "snodes", |
3080 | 3080 |
"admin_state", "admin_ram", |
... | ... | |
3108 | 3108 |
else: |
3109 | 3109 |
self.wanted = locking.ALL_SET |
3110 | 3110 |
|
3111 |
self.do_locking = self._FIELDS_STATIC.NonMatching(self.op.output_fields) |
|
3111 |
self.do_node_query = self._FIELDS_STATIC.NonMatching(self.op.output_fields) |
|
3112 |
self.do_locking = self.do_node_query and self.op.use_locking |
|
3112 | 3113 |
if self.do_locking: |
3113 | 3114 |
self.needed_locks[locking.LEVEL_INSTANCE] = self.wanted |
3114 | 3115 |
self.needed_locks[locking.LEVEL_NODE] = [] |
... | ... | |
3157 | 3158 |
|
3158 | 3159 |
bad_nodes = [] |
3159 | 3160 |
off_nodes = [] |
3160 |
if self.do_locking:
|
|
3161 |
if self.do_node_query:
|
|
3161 | 3162 |
live_data = {} |
3162 | 3163 |
node_data = self.rpc.call_all_instances_info(nodes, hv_list) |
3163 | 3164 |
for name in nodes: |
Also available in: Unified diff