Commit 8d459129 authored by Michael Hanselmann's avatar Michael Hanselmann

Add "use_locking" parameter to network query opcode

This was extracted from a patch by Dimitris Aragiorgis with the subject
“Add locking to _NetworkQuery”. The rest of the patch did no longer
apply and will require more work.
Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parent 27a19bf6
......@@ -16530,7 +16530,7 @@ class LUNetworkQuery(NoHooksLU):
def CheckArguments(self):
self.nq = _NetworkQuery(qlang.MakeSimpleFilter("name", self.op.names),
self.op.output_fields, False)
self.op.output_fields, self.op.use_locking)
def ExpandNames(self):
self.nq.ExpandNames(self)
......
......@@ -2152,6 +2152,7 @@ class OpNetworkQuery(OpCode):
"""Compute the list of networks."""
OP_PARAMS = [
_POutputFields,
_PUseLocking,
("names", ht.EmptyList, ht.TListOf(ht.TNonEmptyString),
"Empty list to query all groups, group names otherwise"),
]
......
......@@ -537,7 +537,7 @@ $(genOpCode "OpCode"
, pNetworkName
, pIpConflictsCheck
])
, ("OpNetworkQuery", dOldQueryNoLocking)
, ("OpNetworkQuery", dOldQuery)
, ("OpRestrictedCommand",
[ pUseLocking
, pRequiredNodes
......
......@@ -335,7 +335,7 @@ instance Arbitrary OpCodes.OpCode where
"OP_NETWORK_DISCONNECT" ->
OpCodes.OpNetworkDisconnect <$> genNameNE <*> genNameNE <*> arbitrary
"OP_NETWORK_QUERY" ->
OpCodes.OpNetworkQuery <$> genFieldsNE <*> genNamesNE
OpCodes.OpNetworkQuery <$> genFieldsNE <*> genNamesNE <*> arbitrary
"OP_RESTRICTED_COMMAND" ->
OpCodes.OpRestrictedCommand <$> arbitrary <*> genNodeNamesNE <*>
genNameNE
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment