Browse Source

add checks to prevent confusing Ice with spaces in the slice path. (no kidding.)

Natenom/support-murmur-13-1446181288462
Michael Ziegler 15 years ago
parent
commit
53d00abd66
  1. 9
      pyweb/mumble/management/commands/checkenv.py

9
pyweb/mumble/management/commands/checkenv.py

@ -42,6 +42,12 @@ class Command( BaseCommand ):
if settings.SLICE is None: if settings.SLICE is None:
raise TestFailed( "You don't have set the SLICE variable in settings.py." ) 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: try:
fd = open( settings.SLICE, "rb" ) fd = open( settings.SLICE, "rb" )
slice = fd.read() slice = fd.read()
@ -49,6 +55,9 @@ class Command( BaseCommand ):
except IOError, err: except IOError, err:
raise TestFailed( "Failed opening the slice file: %s" % err ) raise TestFailed( "Failed opening the slice file: %s" % err )
import Ice
Ice.loadSlice( settings.SLICE )
print "[ OK ]" print "[ OK ]"
def check_rootdir( self ): def check_rootdir( self ):

Loading…
Cancel
Save