Исправлена поведение утилит при недостуной переменной

master3.3
Mike Hiretsky 11 years ago
parent 71e5ea09b4
commit a24e23b3a4

@ -48,6 +48,9 @@ def itemgetter(*args,**kwargs):
return lambda x:(x[args[0]],) return lambda x:(x[args[0]],)
return operator.itemgetter(*args) return operator.itemgetter(*args)
class CriticalError(Exception):
"""Critical error"""
class DataVarsError(Exception): class DataVarsError(Exception):
"""Exception of getting variable values""" """Exception of getting variable values"""
@ -1017,7 +1020,10 @@ class DataVars(SimpleDataVars):
""" """
if not self.iniCache: if not self.iniCache:
# get initialized section names # 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): if os.path.exists(make_profile):
profiles = [('profile', profiles = [('profile',
path.join('/etc',os.readlink(make_profile)))] path.join('/etc',os.readlink(make_profile)))]

Loading…
Cancel
Save