|
@ -19,7 +19,7 @@ import os, getpass |
|
|
from django.db import DatabaseError |
|
|
from django.db import DatabaseError |
|
|
from django.conf import settings |
|
|
from django.conf import settings |
|
|
|
|
|
|
|
|
from mumble import models |
|
|
|
|
|
|
|
|
from mumble.models import MumbleServer, Mumble |
|
|
from mumble.mctl import MumbleCtlBase |
|
|
from mumble.mctl import MumbleCtlBase |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -96,9 +96,9 @@ def find_existing_instances( **kwargs ): |
|
|
servIDs = ctl.getAllServers(); |
|
|
servIDs = ctl.getAllServers(); |
|
|
|
|
|
|
|
|
try: |
|
|
try: |
|
|
meta = models.MumbleServer.objects.get( dbus=dbusName ); |
|
|
|
|
|
except models.MumbleServer.DoesNotExist: |
|
|
|
|
|
meta = models.MumbleServer( dbus=dbusName ); |
|
|
|
|
|
|
|
|
meta = MumbleServer.objects.get( dbus=dbusName ); |
|
|
|
|
|
except MumbleServer.DoesNotExist: |
|
|
|
|
|
meta = MumbleServer( dbus=dbusName ); |
|
|
finally: |
|
|
finally: |
|
|
meta.secret = icesecret; |
|
|
meta.secret = icesecret; |
|
|
meta.save(); |
|
|
meta.save(); |
|
@ -108,8 +108,8 @@ def find_existing_instances( **kwargs ): |
|
|
print "Checking Murmur instance with id %d." % id; |
|
|
print "Checking Murmur instance with id %d." % id; |
|
|
# first check that the server has not yet been inserted into the DB |
|
|
# first check that the server has not yet been inserted into the DB |
|
|
try: |
|
|
try: |
|
|
instance = models.Mumble.objects.get( server=meta, srvid=id ); |
|
|
|
|
|
except models.Mumble.DoesNotExist: |
|
|
|
|
|
|
|
|
instance = Mumble.objects.get( server=meta, srvid=id ); |
|
|
|
|
|
except Mumble.DoesNotExist: |
|
|
values = { |
|
|
values = { |
|
|
"server": meta, |
|
|
"server": meta, |
|
|
"srvid": id, |
|
|
"srvid": id, |
|
@ -119,7 +119,7 @@ def find_existing_instances( **kwargs ): |
|
|
print "Found new Murmur instance %d on bus '%s'... " % ( id, dbusName ), |
|
|
print "Found new Murmur instance %d on bus '%s'... " % ( id, dbusName ), |
|
|
|
|
|
|
|
|
# now create a model for the record set. |
|
|
# now create a model for the record set. |
|
|
instance = models.Mumble( **values ); |
|
|
|
|
|
|
|
|
instance = Mumble( **values ); |
|
|
else: |
|
|
else: |
|
|
if v > 1: |
|
|
if v > 1: |
|
|
print "Syncing Murmur instance... ", |
|
|
print "Syncing Murmur instance... ", |
|
@ -133,7 +133,7 @@ def find_existing_instances( **kwargs ): |
|
|
except DatabaseError, err: |
|
|
except DatabaseError, err: |
|
|
try: |
|
|
try: |
|
|
# Find instances with the same address/port |
|
|
# Find instances with the same address/port |
|
|
dup = models.Mumble.objects.get( addr=instance.addr, port=instance.port ) |
|
|
|
|
|
|
|
|
dup = Mumble.objects.get( addr=instance.addr, port=instance.port ) |
|
|
except Mumble.DoesNotExist: |
|
|
except Mumble.DoesNotExist: |
|
|
# None exist - this must've been something else. |
|
|
# None exist - this must've been something else. |
|
|
print "Server ID / Name: %d / %s" % ( instance.srvid, instance.name ) |
|
|
print "Server ID / Name: %d / %s" % ( instance.srvid, instance.name ) |
|
|