From 53d00abd664c2e550eb9591177f07297397a7dc7 Mon Sep 17 00:00:00 2001 From: Michael Ziegler Date: Wed, 10 Feb 2010 22:48:33 +0100 Subject: [PATCH] add checks to prevent confusing Ice with spaces in the slice path. (no kidding.) --- pyweb/mumble/management/commands/checkenv.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pyweb/mumble/management/commands/checkenv.py b/pyweb/mumble/management/commands/checkenv.py index 615966d..22ca8b4 100644 --- a/pyweb/mumble/management/commands/checkenv.py +++ b/pyweb/mumble/management/commands/checkenv.py @@ -42,6 +42,12 @@ class Command( BaseCommand ): if settings.SLICE is None: raise TestFailed( "You don't have set the SLICE variable in settings.py." ) + if " " in settings.SLICE: + raise TestFailed( "You have a space char in your Slice path. This will confuse Ice, please check." ) + + if not settings.SLICE.endswith( ".ice" ): + raise TestFailed( "The slice file name MUST end with '.ice'." ) + try: fd = open( settings.SLICE, "rb" ) slice = fd.read() @@ -49,6 +55,9 @@ class Command( BaseCommand ): except IOError, err: raise TestFailed( "Failed opening the slice file: %s" % err ) + import Ice + Ice.loadSlice( settings.SLICE ) + print "[ OK ]" def check_rootdir( self ):