Commit 37dc17e3 authored by Thomas Thrainer's avatar Thomas Thrainer
Browse files

Extract network related logical units from cmdlib

LUNetwork* and associated helper functions are extracted to
Signed-off-by: default avatarThomas Thrainer <>
Reviewed-by: default avatarBernardo Dal Seno <>
parent fb3891d0
......@@ -311,7 +311,8 @@ cmdlib_PYTHON = \
lib/cmdlib/ \
lib/cmdlib/ \
lib/cmdlib/ \
lib/cmdlib/ \
hypervisor_PYTHON = \
lib/hypervisor/ \
This diff is collapsed.
......@@ -23,6 +23,7 @@
from ganeti import errors
from ganeti import locking
from ganeti import utils
def _ExpandItemName(fn, name, kind):
......@@ -57,3 +58,27 @@ def _ShareAll():
return dict.fromkeys(locking.LEVELS, 1)
def _CheckNodeGroupInstances(cfg, group_uuid, owned_instances):
"""Checks if the instances in a node group are still correct.
@type cfg: L{config.ConfigWriter}
@param cfg: The cluster configuration
@type group_uuid: string
@param group_uuid: Node group UUID
@type owned_instances: set or frozenset
@param owned_instances: List of currently owned instances
wanted_instances = cfg.GetNodeGroupInstances(group_uuid)
if owned_instances != wanted_instances:
raise errors.OpPrereqError("Instances in node group '%s' changed since"
" locks were acquired, wanted '%s', have '%s';"
" retry the operation" %
return wanted_instances
This diff is collapsed.
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