Revision bc8e4a1a lib/cmdlib.py
b/lib/cmdlib.py | ||
---|---|---|
1753 | 1753 |
"""Logical unit for querying nodes. |
1754 | 1754 |
|
1755 | 1755 |
""" |
1756 |
_OP_REQP = ["output_fields", "names"] |
|
1756 |
_OP_REQP = ["output_fields", "names", "use_locking"]
|
|
1757 | 1757 |
REQ_BGL = False |
1758 | 1758 |
_FIELDS_DYNAMIC = utils.FieldSet( |
1759 | 1759 |
"dtotal", "dfree", |
... | ... | |
1785 | 1785 |
else: |
1786 | 1786 |
self.wanted = locking.ALL_SET |
1787 | 1787 |
|
1788 |
self.do_locking = self._FIELDS_STATIC.NonMatching(self.op.output_fields) |
|
1788 |
self.do_node_query = self._FIELDS_STATIC.NonMatching(self.op.output_fields) |
|
1789 |
self.do_locking = self.do_node_query and self.op.use_locking |
|
1789 | 1790 |
if self.do_locking: |
1790 | 1791 |
# if we don't request only static fields, we need to lock the nodes |
1791 | 1792 |
self.needed_locks[locking.LEVEL_NODE] = self.wanted |
... | ... | |
1820 | 1821 |
|
1821 | 1822 |
# begin data gathering |
1822 | 1823 |
|
1823 |
if self.do_locking:
|
|
1824 |
if self.do_node_query:
|
|
1824 | 1825 |
live_data = {} |
1825 | 1826 |
node_data = self.rpc.call_node_info(nodenames, self.cfg.GetVGName(), |
1826 | 1827 |
self.cfg.GetHypervisorType()) |
Also available in: Unified diff