summaryrefslogtreecommitdiffstats
path: root/src/lib/Server
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2006-10-06 21:06:16 +0000
committerNarayan Desai <desai@mcs.anl.gov>2006-10-06 21:06:16 +0000
commit7beb2f08d8dab26d9fe34235c91c1b2a7a2794bd (patch)
tree92510fa0a9bb4de4c589b8a2f406aa097e0ab3d2 /src/lib/Server
parent53a983ba616d1c2292e1f4117084f85a1db9454f (diff)
downloadbcfg2-7beb2f08d8dab26d9fe34235c91c1b2a7a2794bd.tar.gz
bcfg2-7beb2f08d8dab26d9fe34235c91c1b2a7a2794bd.tar.bz2
bcfg2-7beb2f08d8dab26d9fe34235c91c1b2a7a2794bd.zip
Merge of the client/refactor branch (revisions r2218-r2400)
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@2401 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Server')
-rw-r--r--src/lib/Server/Component.py5
-rw-r--r--src/lib/Server/Plugins/Crontab.py39
2 files changed, 4 insertions, 40 deletions
diff --git a/src/lib/Server/Component.py b/src/lib/Server/Component.py
index f57dd7ccc..f3bd47d34 100644
--- a/src/lib/Server/Component.py
+++ b/src/lib/Server/Component.py
@@ -137,7 +137,10 @@ class Component(SSLServer,
except:
self.logger.error("Failed to load ssl key %s" % (keyfile), exc_info=1)
raise ComponentInitError
- SimpleXMLRPCServer.SimpleXMLRPCDispatcher.__init__(self)
+ try:
+ SimpleXMLRPCServer.SimpleXMLRPCDispatcher.__init__(self)
+ except TypeError:
+ SimpleXMLRPCServer.SimpleXMLRPCDispatcher.__init__(self, False, None)
self.logRequests = 0
self.port = self.socket.getsockname()[1]
self.url = "https://%s:%s" % (socket.gethostname(), self.port)
diff --git a/src/lib/Server/Plugins/Crontab.py b/src/lib/Server/Plugins/Crontab.py
deleted file mode 100644
index fcdf58f42..000000000
--- a/src/lib/Server/Plugins/Crontab.py
+++ /dev/null
@@ -1,39 +0,0 @@
-'''This module manages the crontab file for bcfg2'''
-__revision__ = '$Revision: 1887 $'
-
-import binascii, os, socket, Bcfg2.Server.Plugin, random
-
-class Crontab(Bcfg2.Server.Plugin.Plugin):
- '''This Generates a random set of times for the cron.daily entries to run.
- The goal is to ensure that our Configuration Server/network does get crushed
- all in a 5-10 minute period.
-'''
- __name__ = 'Crontab'
- __version__ = '$Id: Crontab 1887 2006-06-18 02:35:54Z desai $'
- __author__ = 'bcfg-dev@mcs.anl.gov'
-
- def __init__(self, core, datastore):
- Bcfg2.Server.Plugin.Plugin.__init__(self, core, datastore)
- try:
- self.repository = Bcfg2.Server.Plugin.DirectoryBacked(self.data, self.core.fam)
- except OSError, ioerr:
- self.logger.error("Failed to load Crontab repository from %s" % (self.data))
- self.logger.error(ioerr)
- raise Bcfg2.Server.Plugin.PluginInitError
- try:
- prefix = open("%s/prefix" % (self.data)).read().strip()
- except IOError:
- prefix = ''
- self.Entries = {'ConfigFile':
- {prefix + '/etc/crontab':self.build_crontab}}
-
-
- def build_crontab(self, entry, metadata):
- '''This function builds builds a crontab file with a random time for cron.daily'''
- random.seed(metadata.hostname)
- hour = random.randrange(0,6)
- minute = random.randrange(0,59)
- entry.text = self.repository.entries['crontab.template'].data% (minute, hour)
- permdata = {'owner':'root', 'group':'root', 'perms':'0644'}
- [entry.attrib.__setitem__(key, permdata[key]) for key in permdata]
-