On Tue, Sep 14, 2010 at 01:28:47PM +0100, Guido Trotter wrote: > This function allows a node group to be looked up by name or uuid. > If no nodegroup is specified and only one exists, that one is returned. > > Signed-off-by: Guido Trotter <ultrot...@google.com> > --- > lib/config.py | 23 +++++++++++++++++++++++ > 1 files changed, 23 insertions(+), 0 deletions(-) > > diff --git a/lib/config.py b/lib/config.py > index 93f5913..0bb58d6 100644 > --- a/lib/config.py > +++ b/lib/config.py > @@ -845,6 +845,29 @@ class ConfigWriter: > """ > return self._config_data.cluster.primary_ip_family > > + @locking.ssynchronized(_config_lock, shared=1) > + def LookupNodeGroup(self, target): > + """Lookup a node group. > + > + @type target: string > + @param target: group name or uuid
Or None, please document this usage. It seems a bit hackish, usually our ConfigWriter methods don't behave like this, but it's OK. iustin