Updated to current hg head of mumble-django

This commit is contained in:
2010-03-23 10:00:05 +00:00
parent edc5def1f3
commit d2b47da704
57 changed files with 6102 additions and 339 deletions

View File

@@ -14,7 +14,7 @@
* GNU General Public License for more details.
"""
import os, Ice
import os
from django.core.management.base import BaseCommand
from django.contrib.auth.models import User
@@ -28,8 +28,16 @@ class TestFailed( Exception ):
pass;
class Command( BaseCommand ):
help = "Run a few tests on Mumble-Django's setup."
def handle(self, **options):
self.check_slice();
try:
import Ice
except ImportError:
pass
else:
self.check_slice();
self.check_rootdir();
self.check_dbase();
self.check_sites();
@@ -166,10 +174,10 @@ class Command( BaseCommand ):
else:
for mumble in mm:
try:
mumble.getCtl();
except Ice.Exception, err:
mumble.ctl
except Exception, err:
raise TestFailed(
"Connecting to Murmur `%s` (%s) failed: %s" % ( mumble.name, mumble.dbus, err )
"Connecting to Murmur `%s` (%s) failed: %s" % ( mumble.name, mumble.server, err )
);
print "[ OK ]";

View File

@@ -0,0 +1,56 @@
# -*- coding: utf-8 -*-
"""
* Copyright © 2009-2010, Michael "Svedrin" Ziegler <diese-addy@funzt-halt.net>
*
* Mumble-Django is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This package is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
"""
import Ice, IcePy, os, getpass
from sys import stderr
from django.core.management.base import BaseCommand
from mumble.models import MumbleServer
class Command( BaseCommand ):
help = "Check if the known servers support getSlice."
def handle(self, **options):
prop = Ice.createProperties([])
prop.setProperty("Ice.ImplicitContext", "Shared")
idd = Ice.InitializationData()
idd.properties = prop
ice = Ice.initialize(idd)
for serv in MumbleServer.objects.all():
print "Probing server at '%s'..." % serv.dbus
if serv.secret:
ice.getImplicitContext().put( "secret", serv.secret.encode("utf-8") )
prx = ice.stringToProxy( serv.dbus.encode("utf-8") )
# Try loading the Slice from Murmur directly via its getSlice method.
try:
slice = IcePy.Operation( 'getSlice',
Ice.OperationMode.Idempotent, Ice.OperationMode.Idempotent,
True, (), (), (), IcePy._t_string, ()
).invoke(prx, ((), None))
except TypeError, err:
print " Received TypeError:", err
print " It seems your version of IcePy is incompatible."
except Ice.OperationNotExistException:
print " Your version of Murmur does not support getSlice."
else:
print " Successfully received the slice (length: %d bytes.)" % len(slice)