Commit e85d8982 authored by Stephen Shirley's avatar Stephen Shirley Committed by René Nussbaumer
Browse files

Add _UnlockedLookupNodeGroup()



This allows calling of _UnlockedLookupNodeGroup() from within
AddNodeGroup()
Signed-off-by: default avatarStephen Shirley <diamond@google.com>
Reviewed-by: default avatarRené Nussbaumer <rn@google.com>
parent be8aecab
......@@ -969,8 +969,7 @@ class ConfigWriter:
self._config_data.cluster.serial_no += 1
self._WriteConfig()
@locking.ssynchronized(_config_lock, shared=1)
def LookupNodeGroup(self, target):
def _UnlockedLookupNodeGroup(self, target):
"""Lookup a node group's UUID.
@type target: string or None
......@@ -994,6 +993,20 @@ class ConfigWriter:
raise errors.OpPrereqError("Node group '%s' not found" % target,
errors.ECODE_NOENT)
@locking.ssynchronized(_config_lock, shared=1)
def LookupNodeGroup(self, target):
"""Lookup a node group's UUID.
This function is just a wrapper over L{_UnlockedLookupNodeGroup}.
@type target: string or None
@param target: group name or UUID or None to look for the default
@rtype: string
@return: nodegroup UUID
"""
return self._UnlockedLookupNodeGroup(target)
def _UnlockedGetNodeGroup(self, uuid):
"""Lookup a node group.
......
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