Remove SomethingFishyException

Just use a plain Exception instead since we don't get any added value by
subclassing.

Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Dan McGee 2010-09-10 10:11:09 -05:00
parent eaa76ae758
commit 2470fb92e9

View File

@ -39,11 +39,6 @@
from main.models import Arch, Package, Repo from main.models import Arch, Package, Repo
class SomethingFishyException(Exception):
'''Raised when the database looks like its going to wipe out a bunch of
packages.'''
pass
logging.basicConfig( logging.basicConfig(
level=WARNING, level=WARNING,
format='%(asctime)s -> %(levelname)s: %(message)s', format='%(asctime)s -> %(levelname)s: %(message)s',
@ -291,7 +286,7 @@ def db_update(archname, reponame, pkgs, options):
logger.info("DB package ratio: %.1f%%" % dbpercent) logger.info("DB package ratio: %.1f%%" % dbpercent)
if dbpercent < 50.0 and not repository.testing: if dbpercent < 50.0 and not repository.testing:
logger.error(".db.tar.gz has %.1f%% the number of packages in the web database" % dbpercent) logger.error(".db.tar.gz has %.1f%% the number of packages in the web database" % dbpercent)
raise SomethingFishyException( raise Exception(
'It looks like the syncdb is less than half the size of the web db. WTF?') 'It looks like the syncdb is less than half the size of the web db. WTF?')
if dbpercent < 75.0: if dbpercent < 75.0:
@ -388,7 +383,7 @@ def parse_repo(repopath):
reponame = m.group(1) reponame = m.group(1)
else: else:
logger.error("File does not have the proper extension") logger.error("File does not have the proper extension")
raise SomethingFishyException("File does not have the proper extension") raise Exception("File does not have the proper extension")
repodb = tarfile.open(repopath,"r:gz") repodb = tarfile.open(repopath,"r:gz")
## assuming well formed tar, with dir first then files after ## assuming well formed tar, with dir first then files after