diff options
-rw-r--r-- | master/autotua/process/__init__.py | 4 | ||||
-rw-r--r-- | master/autotua/process/validate.py | 11 |
2 files changed, 6 insertions, 9 deletions
diff --git a/master/autotua/process/__init__.py b/master/autotua/process/__init__.py index 13ec6d2..75d86b3 100644 --- a/master/autotua/process/__init__.py +++ b/master/autotua/process/__init__.py @@ -7,8 +7,6 @@ # import random -from django.core.validators import ValidationError -import const, validate from autotua import jobuild, sync schemes = ['http', 'https', 'ftp'] @@ -33,7 +31,7 @@ def _get_arch_dir(arch): for i in const.ARCHS: if arch in const.ARCHS[i]: return i - raise ValidationError(const.VERRORS['invalid_arch'] % i) + raise Exception(const.VERRORS['invalid_arch'] % i) def _get_deplist(atoms, rev): """ diff --git a/master/autotua/process/validate.py b/master/autotua/process/validate.py index 9a84537..dcbc201 100644 --- a/master/autotua/process/validate.py +++ b/master/autotua/process/validate.py @@ -7,29 +7,28 @@ # from datetime import datetime -from django.core.validators import ValidationError import const def is_stage(stage): if stage not in const.STAGES: - raise ValidationError(const.VERRORS['invalid_stage'] % stage) + raise Exception(const.VERRORS['invalid_stage'] % stage) return True def is_arch(arch): if arch not in const.ARCHS['all']: - raise ValidationError(const.VERRORS['invalid_arch'] % i) + raise Exception(const.VERRORS['invalid_arch'] % i) return True def is_type(type): if type not in const.STAGE_TYPE: - raise ValidationError(const.VERRORS['invalid_type'] % type) + raise Exception(const.VERRORS['invalid_type'] % type) return True def is_release(release): year, state = release.split('_', 1) try: if int(year.split('.', 1)[0]) > datetime.now().year: - raise ValidationError(const.VERRORS['invalid_release'] % release) + raise Exception(const.VERRORS['invalid_release'] % release) except: - raise ValidationError(const.VERRORS['invalid_release'] % release) + raise Exception(const.VERRORS['invalid_release'] % release) return True |