From a819e30b1e6f049693541b1e6e9c7da22e182389 Mon Sep 17 00:00:00 2001 From: Michael Ziegler Date: Wed, 10 Feb 2010 23:35:01 +0100 Subject: [PATCH] add common slice error checks to the control object factory. --- pyweb/mumble/MumbleCtlIce.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pyweb/mumble/MumbleCtlIce.py b/pyweb/mumble/MumbleCtlIce.py index ae4219d..1aa420b 100644 --- a/pyweb/mumble/MumbleCtlIce.py +++ b/pyweb/mumble/MumbleCtlIce.py @@ -61,6 +61,12 @@ def MumbleCtlIce( connstring ): if not exists( settings.SLICE ): raise EnvironmentError( "The slice file does not exist: '%s' - please check the settings." % settings.SLICE ) + if " " in settings.SLICE: + raise EnvironmentError( "You have a space char in your Slice path. This will confuse Ice, please check." ) + + if not settings.SLICE.endswith( ".ice" ): + raise EnvironmentError( "The slice file name MUST end with '.ice'." ) + Ice.loadSlice( settings.SLICE ) ice = Ice.initialize()