summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Gogolok <gogo@cs.uni-sb.de>2007-12-31 12:36:02 +0000
committerRobert Gogolok <gogo@cs.uni-sb.de>2007-12-31 12:36:02 +0000
commitb901a50ab5c402897b67cdecf291e03192bb330d (patch)
treee3217dbac7133a4cb2569881b088a52f0e80fc06
parent0f7d5f15086454c45d05afab9a54448dfa440df2 (diff)
downloadbcfg2-b901a50ab5c402897b67cdecf291e03192bb330d.tar.gz
bcfg2-b901a50ab5c402897b67cdecf291e03192bb330d.tar.bz2
bcfg2-b901a50ab5c402897b67cdecf291e03192bb330d.zip
cleanup code
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4145 ce84e21b-d406-0410-9b95-82705330c041
-rw-r--r--src/lib/Component.py11
-rwxr-xr-xsrc/sbin/bcfg2-server17
2 files changed, 16 insertions, 12 deletions
diff --git a/src/lib/Component.py b/src/lib/Component.py
index 2d6887a67..ec5e9d41d 100644
--- a/src/lib/Component.py
+++ b/src/lib/Component.py
@@ -147,11 +147,12 @@ class Component(TLSServer,
self.logger = logging.getLogger('Component')
self.children = []
self.static = True
- options = {'location': Bcfg2.Options.SERVER_LOCATION,
- 'static': Bcfg2.Options.SERVER_STATIC,
- 'key': Bcfg2.Options.SERVER_KEY,
- 'passwd': Bcfg2.Options.SERVER_PASSWORD,
- }
+ options = {
+ 'key' : Bcfg2.Options.SERVER_KEY,
+ 'location' : Bcfg2.Options.SERVER_LOCATION,
+ 'passwd' : Bcfg2.Options.SERVER_PASSWORD,
+ 'static' : Bcfg2.Options.SERVER_STATIC,
+ }
opts = Bcfg2.Options.OptionParser(options)
opts.parse([])
location = opts['location']
diff --git a/src/sbin/bcfg2-server b/src/sbin/bcfg2-server
index 393cae471..ecb5b357d 100755
--- a/src/sbin/bcfg2-server
+++ b/src/sbin/bcfg2-server
@@ -20,7 +20,7 @@ def critical_error(operation):
raise Fault, (7, "Critical unexpected failure: %s" % (operation))
class SetupError(Exception):
- '''Used when the server cant be setup'''
+ '''Used when the server can't be setup'''
pass
class Bcfg2Serv(Bcfg2.Component.Component):
@@ -34,7 +34,7 @@ class Bcfg2Serv(Bcfg2.Component.Component):
def __init__(self, setup):
try:
Bcfg2.Component.Component.__init__(self, setup)
- self.shut = False
+ self.shut = False # FIXME doc why this is needed here
except Bcfg2.Component.ComponentInitError:
raise SetupError
@@ -45,16 +45,19 @@ class Bcfg2Serv(Bcfg2.Component.Component):
raise SystemExit, 1
self.funcs.update({
- "AssertProfile": self.Bcfg2AssertProfile,
- "GetConfig": self.Bcfg2GetConfig,
- "GetProbes": self.Bcfg2GetProbes,
- "RecvProbeData": self.Bcfg2RecvProbeData,
- "RecvStats": self.Bcfg2RecvStats
+ "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__:
self.register_function(getattr(self.Core.plugins[plugin.__name__], method),
"%s.%s" % (plugin.__name__, method))
+
famfd = self.Core.fam.fileno()
events = False
while True: