diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2009-05-20 02:24:37 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2009-05-20 02:24:37 +0000 |
commit | bbfcb5925f70af255da2c8761b490600b63be777 (patch) | |
tree | b9788d2e7346d993ce6a61d1eaf42809b9db8b7d /src/lib | |
parent | ae3c07c882a5ceaa254ae4633a656e6abb5d3062 (diff) | |
download | bcfg2-bbfcb5925f70af255da2c8761b490600b63be777.tar.gz bcfg2-bbfcb5925f70af255da2c8761b490600b63be777.tar.bz2 bcfg2-bbfcb5925f70af255da2c8761b490600b63be777.zip |
Implement cert bootstrap mode for SSL auth
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5246 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/Server/Plugins/Metadata.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/lib/Server/Plugins/Metadata.py b/src/lib/Server/Plugins/Metadata.py index e51135b7e..de0a68df1 100644 --- a/src/lib/Server/Plugins/Metadata.py +++ b/src/lib/Server/Plugins/Metadata.py @@ -56,7 +56,8 @@ class ClientMetadata(object): class Metadata(Bcfg2.Server.Plugin.Plugin, - Bcfg2.Server.Plugin.Metadata): + Bcfg2.Server.Plugin.Metadata, + Bcfg2.Server.Plugin.Statistics): '''This class contains data for bcfg2 server metadata''' __version__ = '$Id$' __author__ = 'bcfg-dev@mcs.anl.gov' @@ -208,7 +209,8 @@ class Metadata(Bcfg2.Server.Plugin.Plugin, else: self.addresses[caddr] = [clname] if 'auth' in client.attrib: - self.auth[client.get('name')] = client.get('auth') + self.auth[client.get('name')] = client.get('auth', + 'cert+password') if 'uuid' in client.attrib: self.uuid[client.get('uuid')] = clname if client.get('secure', 'false') == 'true' : @@ -516,6 +518,15 @@ class Metadata(Bcfg2.Server.Plugin.Plugin, '''Return a list of clients that are members of a given profile''' return [client for client in self.clients \ if self.clients[client] == profile] + + def process_statistics(self, meta, _): + '''Hook into statistics interface to toggle clients in bootstrap mode''' + client = meta.hostname + if client in self.auth and self.auth[client] == 'bootstrap': + cli = self.clientdata_original.xpath('.//Client[@name="%s"]' \ + % (client)) + cli[0].set('auth', 'cert') + self.write_back_clients() def viz(self, hosts, bundles, key, colors): '''admin mode viz support''' |