diff options
author | Adrian Likins <root@grimlock.devel.redhat.com> | 2008-03-17 17:10:32 -0400 |
---|---|---|
committer | root <root@grimlock.devel.redhat.com> | 2008-03-17 17:10:32 -0400 |
commit | af4f09f155f4a4f1c5a9e3e29b4c8736f892dce4 (patch) | |
tree | 7b15cd3d6dae2e1940b5cdebbdffa12bc1474fde /certmaster/overlord/groups.py | |
parent | 6146feb4b676ba7e10f5f175bb50149c20c53b18 (diff) | |
download | certmaster-af4f09f155f4a4f1c5a9e3e29b4c8736f892dce4.tar.gz certmaster-af4f09f155f4a4f1c5a9e3e29b4c8736f892dce4.tar.xz certmaster-af4f09f155f4a4f1c5a9e3e29b4c8736f892dce4.zip |
remove unused certmaster/minion/ and certmaster/overlord/ dirs
update spec and setup accordingly
Diffstat (limited to 'certmaster/overlord/groups.py')
-rw-r--r-- | certmaster/overlord/groups.py | 95 |
1 files changed, 0 insertions, 95 deletions
diff --git a/certmaster/overlord/groups.py b/certmaster/overlord/groups.py deleted file mode 100644 index 8eaf28e..0000000 --- a/certmaster/overlord/groups.py +++ /dev/null @@ -1,95 +0,0 @@ -#!/usr/bin/python - -## func command line interface & client lib -## -## Copyright 2007,2008 Red Hat, Inc -## Adrian Likins <alikins@redhat.com> -## +AUTHORS -## -## This software may be freely redistributed under the terms of the GNU -## general public license. -## -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -## - - -# this module lets you define groups of systems to work with from the -# commandline. It uses an "ini" style config parser like: - -#[groupname] -#host = foobar, baz, blip -#subgroup = blippy - - -import ConfigParser -import os - - -class Groups(object): - - def __init__(self, filename="/etc/func/groups"): - self.filename = filename - self.group_names = {} - self.groups = {} - self.__parse() - - def __parse(self): - - self.cp = ConfigParser.SafeConfigParser() - self.cp.read(self.filename) - - for section in self.cp.sections(): - self.add_group(section) - options = self.cp.options(section) - for option in options: - if option == "host": - self.add_hosts_to_group(section, self.cp.get(section, option)) - if option == "subgroup": - pass - - - def show(self): - print self.cp.sections() - print self.groups - - def add_group(self, group): - pass - - def __parse_hoststrings(self, hoststring): - hosts = [] - bits = hoststring.split(';') - for bit in bits: - blip = bit.strip().split(' ') - for host in blip: - if host not in hosts: - hosts.append(host.strip()) - - return hosts - - def add_hosts_to_group(self, group, hoststring): - hosts = self.__parse_hoststrings(hoststring) - for host in hosts: - self.add_host_to_group(group, host) - - - - def add_host_to_group(self, group, host): - if not self.groups.has_key(group): - self.groups[group] = [] - self.groups[group].append(host) - - def get_groups(self): - return self.groups - - - -def main(): - g = Groups("/tmp/testgroups") - print g.show() - - - -if __name__ == "__main__": - main() |