Moved Issue type into Issue class
This commit is contained in:
parent
18db66377b
commit
83b1bee14f
@ -91,11 +91,11 @@ class Error:
|
||||
def __str__(self):
|
||||
return self.message
|
||||
|
||||
ERROR = 'ERROR'
|
||||
WARNING = 'WARNING'
|
||||
INFO = 'INFO'
|
||||
|
||||
class Issue(object):
|
||||
ERROR = 'ERROR'
|
||||
WARNING = 'WARNING'
|
||||
INFO = 'INFO'
|
||||
|
||||
def __init__(self, type, message):
|
||||
self.type = type
|
||||
self.message = message
|
||||
|
@ -1,6 +1,6 @@
|
||||
from ostack_validator.common import Mark, MarkedIssue, ERROR
|
||||
from ostack_validator.common import Mark, Issue, MarkedIssue
|
||||
|
||||
class ParseError(MarkedIssue):
|
||||
def __init__(self, message, mark):
|
||||
super(ParseError, self).__init__(ERROR, message, mark)
|
||||
super(ParseError, self).__init__(Issue.ERROR, message, mark)
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import logging
|
||||
|
||||
from ostack_validator.common import Error, Mark, Issue, Inspection
|
||||
from ostack_validator.common import Error, Mark, Issue, MarkedIssue, Inspection
|
||||
from ostack_validator.schema import ConfigSchemaRegistry, TypeValidatorRegistry
|
||||
import ostack_validator.schemas
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import sys
|
||||
|
||||
from ostack_validator.common import Inspection, MarkedIssue, ERROR, Mark, Version, find, index
|
||||
from ostack_validator.common import Inspection, Issue, MarkedIssue, Mark, Version, find, index
|
||||
|
||||
class SchemaUpdateRecord(object):
|
||||
# checkpoint's data is version number
|
||||
@ -167,7 +167,7 @@ class TypeValidatorRegistry:
|
||||
|
||||
class InvalidValueError(MarkedIssue):
|
||||
def __init__(self, message, mark=Mark('', 1, 1)):
|
||||
super(InvalidValueError, self).__init__(ERROR, message, mark)
|
||||
super(InvalidValueError, self).__init__(Issue.ERROR, message, mark)
|
||||
|
||||
class TypeValidator(object):
|
||||
def __init__(self, f):
|
||||
|
Loading…
x
Reference in New Issue
Block a user