From effb6b3d6d9657ac241ad9ae9649b0d890363a90 Mon Sep 17 00:00:00 2001 From: Narayan Desai Date: Tue, 5 Aug 2008 14:24:37 +0000 Subject: bcfg2-server: process initial events before binding to socket git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4851 ce84e21b-d406-0410-9b95-82705330c041 --- src/sbin/bcfg2-server | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) (limited to 'src/sbin/bcfg2-server') diff --git a/src/sbin/bcfg2-server b/src/sbin/bcfg2-server index 836f1ee27..18091d55c 100755 --- a/src/sbin/bcfg2-server +++ b/src/sbin/bcfg2-server @@ -32,13 +32,6 @@ class Bcfg2Serv(Bcfg2.Component.Component): request_queue_size = 15 def __init__(self, setup): - try: - Bcfg2.Component.Component.__init__(self, setup['key'], - setup['password'], - setup['location']) - except Bcfg2.Component.ComponentInitError: - raise SetupError - try: self.Core = Core(setup['repo'], setup['plugins'], setup['structures'], setup['generators'], setup['password'], @@ -50,14 +43,6 @@ class Bcfg2Serv(Bcfg2.Component.Component): if 'DBStats' in self.Core.plugins: self.fork_funcs.append("RecvStats") - self.funcs.update({ - "AssertProfile" : self.Bcfg2AssertProfile, - "GetConfig" : self.Bcfg2GetConfig, - "GetProbes" : self.Bcfg2GetProbes, - "RecvProbeData" : self.Bcfg2RecvProbeData, - "RecvStats" : self.Bcfg2RecvStats - }) - # init functions to be exposed as XML-RPC functions for plugin in self.Core.plugins.values(): for method in plugin.__rmi__: @@ -79,6 +64,22 @@ class Bcfg2Serv(Bcfg2.Component.Component): self.Core.Service() except socket.error: continue + try: + Bcfg2.Component.Component.__init__(self, setup['key'], + setup['password'], + setup['location']) + except Bcfg2.Component.ComponentInitError: + raise SetupError + + self.funcs.update({ + "AssertProfile" : self.Bcfg2AssertProfile, + "GetConfig" : self.Bcfg2GetConfig, + "GetProbes" : self.Bcfg2GetProbes, + "RecvProbeData" : self.Bcfg2RecvProbeData, + "RecvStats" : self.Bcfg2RecvStats + }) + + def get_request(self): '''We need to do work between requests, so select with timeout instead of blocking in accept''' -- cgit v1.2.3-1-g7c22