from toscaparser.utils.gettextutils import _
-log = logging.getLogger(__name__)
+log = logging.getLogger('tosca')
class TOSCAException(Exception):
@staticmethod
def removeException(exception_type):
- if ExceptionCollector.collecting:
+ if ExceptionCollector.collecting and ExceptionCollector.exceptions:
for i, e in enumerate(ExceptionCollector.exceptions):
if isinstance(e, exception_type):
del ExceptionCollector.exceptions[i]
from toscaparser.common.exception import ExceptionCollector
from toscaparser.common.exception import InvalidTemplateVersion
from toscaparser.common.exception import MissingRequiredFieldError
+from toscaparser.common.exception import MissingRequiredInputError
+from toscaparser.common.exception import MissingRequiredOutputError
from toscaparser.common.exception import MissingRequiredParameterError
from toscaparser.common.exception import UnknownFieldError
from toscaparser.common.exception import ValidationError
% {'path': path}))
def verify_template(self):
+ if self.no_required_paras_check:
+ ExceptionCollector.removeException(
+ MissingRequiredParameterError)
+ ExceptionCollector.removeException(
+ MissingRequiredInputError)
+ ExceptionCollector.removeException(
+ MissingRequiredOutputError)
if ExceptionCollector.exceptionsCaught():
- if self.no_required_paras_check:
- ExceptionCollector.removeException(
- MissingRequiredParameterError)
-
if self.input_path:
exceptions = ValidationError(
message=(_('\nThe input "%(path)s" failed validation with '