summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2008-08-05 14:24:37 +0000
committerNarayan Desai <desai@mcs.anl.gov>2008-08-05 14:24:37 +0000
commiteffb6b3d6d9657ac241ad9ae9649b0d890363a90 (patch)
treead8c7186cff938ad432f316d7ff079609793282b /src
parentd2f3c24d9a0d5fe92bb4424656f60bf639bab2aa (diff)
downloadbcfg2-effb6b3d6d9657ac241ad9ae9649b0d890363a90.tar.gz
bcfg2-effb6b3d6d9657ac241ad9ae9649b0d890363a90.tar.bz2
bcfg2-effb6b3d6d9657ac241ad9ae9649b0d890363a90.zip
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
Diffstat (limited to 'src')
-rwxr-xr-xsrc/sbin/bcfg2-server31
1 files changed, 16 insertions, 15 deletions
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
@@ -33,13 +33,6 @@ class Bcfg2Serv(Bcfg2.Component.Component):
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'],
setup['svn'], setup['encoding'])
@@ -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'''