From 5f73c19d947d0dfb6821cd25a7e180614e77f10b Mon Sep 17 00:00:00 2001 From: Michael Ziegler Date: Sun, 21 Feb 2010 16:03:09 +0100 Subject: [PATCH] prevent checkenv from failing if Ice is not available. --- pyweb/mumble/management/commands/checkenv.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pyweb/mumble/management/commands/checkenv.py b/pyweb/mumble/management/commands/checkenv.py index cfe84e0..6468d63 100644 --- a/pyweb/mumble/management/commands/checkenv.py +++ b/pyweb/mumble/management/commands/checkenv.py @@ -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 @@ -29,7 +29,13 @@ class TestFailed( Exception ): class Command( BaseCommand ): 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(); @@ -167,7 +173,7 @@ class Command( BaseCommand ): for mumble in mm: try: mumble.ctl - except Ice.Exception, err: + except Exception, err: raise TestFailed( "Connecting to Murmur `%s` (%s) failed: %s" % ( mumble.name, mumble.server, err ) );