diff --git a/mumo.py b/mumo.py index f411004..150652b 100644 --- a/mumo.py +++ b/mumo.py @@ -56,7 +56,10 @@ default.update({'ice':(('host', str, '127.0.0.1'), ('port', int, 6502), ('slice', str, 'Murmur.ice'), ('secret', str, ''), - ('watchdog', int, 30)), + ('slicedir', str, '/usr/share/slice'), + ('watchdog', int, 30), + ('callback_host', str, '127.0.0.1'), + ('callback_port', int, -1)), 'iceraw':None, 'murmur':(('servers', commaSeperatedIntegers, []),), @@ -68,7 +71,11 @@ def do_main_program(): #--- Moderator implementation # All of this has to go in here so we can correctly daemonize the tool # without loosing the file descriptors opened by the Ice module - Ice.loadSlice('', ['-I' + Ice.getSliceDir(), cfg.ice.slice]) + if not hasattr(Ice, "getSliceDir"): + Ice.loadSlice('-I%s %s' % (cfg.ice.slicedir, cfg.ice.slice)) + else: + Ice.loadSlice('', ['-I' + Ice.getSliceDir(), cfg.ice.slice]) + import Murmur class mumoIceApp(Ice.Application): @@ -112,7 +119,12 @@ def do_main_program(): base = ice.stringToProxy('Meta:tcp -h %s -p %d' % (cfg.ice.host, cfg.ice.port)) self.meta = Murmur.MetaPrx.uncheckedCast(base) - adapter = ice.createObjectAdapterWithEndpoints('Callback.Client', 'tcp -h %s' % cfg.ice.host) + if cfg.ice.callback_port > 0: + cbp = ' -p %d' % cfg.ice.callback_port + else: + cbp = '' + + adapter = ice.createObjectAdapterWithEndpoints('Callback.Client', 'tcp -h %s%s' % (cfg.ice.callback_host, cbp)) adapter.activate() self.adapter = adapter diff --git a/mumo_manager.py b/mumo_manager.py index 64a5055..c35e35d 100644 --- a/mumo_manager.py +++ b/mumo_manager.py @@ -519,7 +519,7 @@ class MumoManager(Worker): for name in names: try: modinst = self.modules[name] - if not modinst.is_alive(): + if not modinst.isAlive(): modinst.start() log.debug("Module '%s' started", name) else: @@ -566,7 +566,7 @@ class MumoManager(Worker): except Queue.Empty: pass for modinst in stoppedmodules.itervalues(): - if modinst.is_alive(): + if modinst.isAlive(): modinst.stop() log.debug("Module '%s' is being stopped", name) else: