From bca510c2645ff24e5373dc0e7ff978ba7184693d Mon Sep 17 00:00:00 2001 From: Adrian Likins Date: Tue, 12 Feb 2008 12:55:40 -0500 Subject: move some methods into the Groups class. --- func/overlord/groups.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'func/overlord/groups.py') diff --git a/func/overlord/groups.py b/func/overlord/groups.py index 8eaf28e..b392032 100644 --- a/func/overlord/groups.py +++ b/func/overlord/groups.py @@ -83,6 +83,18 @@ class Groups(object): def get_groups(self): return self.groups + def get_hosts_by_groupgoo(self, groupgoo): + group_gloobs = groupgoo.split(':') + hosts = [] + for group_gloob in group_gloobs: + if not group_gloob[0] == "@": + continue + if self.groups.has_key(group_gloob[1:]): + hosts = hosts + self.groups[group_gloob[1:]] + else: + print "group %s not defined" % group_gloob + return hosts + def main(): -- cgit