From a24e23b3a4ebea014376bbe96596f4340c7819d4 Mon Sep 17 00:00:00 2001 From: Mike Hiretsky Date: Wed, 16 Apr 2014 10:21:35 +0400 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D0=BF=D0=BE=D0=B2=D0=B5=D0=B4=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D1=83=D1=82=D0=B8=D0=BB=D0=B8=D1=82=20=D0=BF?= =?UTF-8?q?=D1=80=D0=B8=20=D0=BD=D0=B5=D0=B4=D0=BE=D1=81=D1=82=D1=83=D0=BD?= =?UTF-8?q?=D0=BE=D0=B9=20=D0=BF=D0=B5=D1=80=D0=B5=D0=BC=D0=B5=D0=BD=D0=BD?= =?UTF-8?q?=D0=BE=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- calculate/lib/datavars.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/calculate/lib/datavars.py b/calculate/lib/datavars.py index 3690083..b5f2d33 100644 --- a/calculate/lib/datavars.py +++ b/calculate/lib/datavars.py @@ -48,6 +48,9 @@ def itemgetter(*args,**kwargs): return lambda x:(x[args[0]],) return operator.itemgetter(*args) +class CriticalError(Exception): + """Critical error""" + class DataVarsError(Exception): """Exception of getting variable values""" @@ -1017,7 +1020,10 @@ class DataVars(SimpleDataVars): """ if not self.iniCache: # get initialized section names - make_profile = self.Get('main.cl_make_profile') + try: + make_profile = self.Get('main.cl_make_profile') + except VariableError as e: + raise CriticalError(str(e)) if os.path.exists(make_profile): profiles = [('profile', path.join('/etc',os.readlink(make_profile)))]