Fix python 2.6 compatibility for moto/swf
This commit is contained in:
parent
90c8797abd
commit
e9732140e5
7 changed files with 31 additions and 31 deletions
|
|
@ -14,9 +14,9 @@ class SWFClientError(JSONResponseError):
|
|||
class SWFUnknownResourceFault(SWFClientError):
|
||||
def __init__(self, resource_type, resource_name=None):
|
||||
if resource_name:
|
||||
message = "Unknown {}: {}".format(resource_type, resource_name)
|
||||
message = "Unknown {0}: {1}".format(resource_type, resource_name)
|
||||
else:
|
||||
message = "Unknown {}".format(resource_type)
|
||||
message = "Unknown {0}".format(resource_type)
|
||||
super(SWFUnknownResourceFault, self).__init__(
|
||||
message,
|
||||
"com.amazonaws.swf.base.model#UnknownResourceFault")
|
||||
|
|
@ -39,7 +39,7 @@ class SWFDomainDeprecatedFault(SWFClientError):
|
|||
class SWFSerializationException(JSONResponseError):
|
||||
def __init__(self, value):
|
||||
message = "class java.lang.Foo can not be converted to an String "
|
||||
message += " (not a real SWF exception ; happened on: {})".format(value)
|
||||
message += " (not a real SWF exception ; happened on: {0})".format(value)
|
||||
__type = "com.amazonaws.swf.base.model#SerializationException"
|
||||
super(SWFSerializationException, self).__init__(
|
||||
400, "Bad Request",
|
||||
|
|
@ -50,14 +50,14 @@ class SWFSerializationException(JSONResponseError):
|
|||
class SWFTypeAlreadyExistsFault(SWFClientError):
|
||||
def __init__(self, _type):
|
||||
super(SWFTypeAlreadyExistsFault, self).__init__(
|
||||
"{}=[name={}, version={}]".format(_type.__class__.__name__, _type.name, _type.version),
|
||||
"{0}=[name={1}, version={2}]".format(_type.__class__.__name__, _type.name, _type.version),
|
||||
"com.amazonaws.swf.base.model#TypeAlreadyExistsFault")
|
||||
|
||||
|
||||
class SWFTypeDeprecatedFault(SWFClientError):
|
||||
def __init__(self, _type):
|
||||
super(SWFTypeDeprecatedFault, self).__init__(
|
||||
"{}=[name={}, version={}]".format(_type.__class__.__name__, _type.name, _type.version),
|
||||
"{0}=[name={1}, version={2}]".format(_type.__class__.__name__, _type.name, _type.version),
|
||||
"com.amazonaws.swf.base.model#TypeDeprecatedFault")
|
||||
|
||||
|
||||
|
|
@ -107,14 +107,14 @@ class SWFDecisionValidationException(SWFClientError):
|
|||
)
|
||||
else:
|
||||
raise ValueError(
|
||||
"Unhandled decision constraint type: {}".format(pb["type"])
|
||||
"Unhandled decision constraint type: {0}".format(pb["type"])
|
||||
)
|
||||
# prefix
|
||||
count = len(problems)
|
||||
if count < 2:
|
||||
prefix = "{} validation error detected: "
|
||||
prefix = "{0} validation error detected: "
|
||||
else:
|
||||
prefix = "{} validation errors detected: "
|
||||
prefix = "{0} validation errors detected: "
|
||||
super(SWFDecisionValidationException, self).__init__(
|
||||
prefix.format(count) + "; ".join(messages),
|
||||
"com.amazon.coral.validate#ValidationException"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue