diff --git a/lib/cmdlib.py b/lib/cmdlib.py index 81ecc0566dc5dda403e7af33ef907d70dcd937c7..633d8e59d283d2c53253feaa25c8ae486d9f7b2e 100644 --- a/lib/cmdlib.py +++ b/lib/cmdlib.py @@ -4788,6 +4788,14 @@ class LURemoveExport(NoHooksLU): """ _OP_REQP = ["instance_name"] + REQ_BGL = False + + def ExpandNames(self): + self.needed_locks = {} + # We need all nodes to be locked in order for RemoveExport to work, but we + # don't need to lock the instance itself, as nothing will happen to it (and + # we can remove exports also for a removed instance) + self.needed_locks[locking.LEVEL_NODE] = locking.ALL_SET def CheckPrereq(self): """Check prerequisites. @@ -4806,7 +4814,7 @@ class LURemoveExport(NoHooksLU): fqdn_warn = True instance_name = self.op.instance_name - exportlist = rpc.call_export_list(self.cfg.GetNodeList()) + exportlist = rpc.call_export_list(self.acquired_locks[locking.LEVEL_NODE]) found = False for node in exportlist: if instance_name in exportlist[node]: