Fix style issues

This commit is contained in:
Ian Fillion-de Kiewit 2016-02-02 14:02:37 -05:00
commit 129b4faff8
21 changed files with 244 additions and 163 deletions

View file

@ -4,82 +4,82 @@
# and subsequent docs for each decision type.
DECISIONS_FIELDS = {
"cancelTimerDecisionAttributes": {
"timerId": { "type": "string", "required": True }
"timerId": {"type": "string", "required": True}
},
"cancelWorkflowExecutionDecisionAttributes": {
"details": { "type": "string", "required": False }
"details": {"type": "string", "required": False}
},
"completeWorkflowExecutionDecisionAttributes": {
"result": { "type": "string", "required": False }
"result": {"type": "string", "required": False}
},
"continueAsNewWorkflowExecutionDecisionAttributes": {
"childPolicy": { "type": "string", "required": False },
"executionStartToCloseTimeout": { "type": "string", "required": False },
"input": { "type": "string", "required": False },
"lambdaRole": { "type": "string", "required": False },
"tagList": { "type": "string", "array": True, "required": False },
"taskList": { "type": "TaskList", "required": False },
"taskPriority": { "type": "string", "required": False },
"taskStartToCloseTimeout": { "type": "string", "required": False },
"workflowTypeVersion": { "type": "string", "required": False }
"childPolicy": {"type": "string", "required": False},
"executionStartToCloseTimeout": {"type": "string", "required": False},
"input": {"type": "string", "required": False},
"lambdaRole": {"type": "string", "required": False},
"tagList": {"type": "string", "array": True, "required": False},
"taskList": {"type": "TaskList", "required": False},
"taskPriority": {"type": "string", "required": False},
"taskStartToCloseTimeout": {"type": "string", "required": False},
"workflowTypeVersion": {"type": "string", "required": False}
},
"failWorkflowExecutionDecisionAttributes": {
"details": { "type": "string", "required": False },
"reason": { "type": "string", "required": False }
"details": {"type": "string", "required": False},
"reason": {"type": "string", "required": False}
},
"recordMarkerDecisionAttributes": {
"details": { "type": "string", "required": False },
"markerName": { "type": "string", "required": True }
"details": {"type": "string", "required": False},
"markerName": {"type": "string", "required": True}
},
"requestCancelActivityTaskDecisionAttributes": {
"activityId": { "type": "string", "required": True }
"activityId": {"type": "string", "required": True}
},
"requestCancelExternalWorkflowExecutionDecisionAttributes": {
"control": { "type": "string", "required": False },
"runId": { "type": "string", "required": False },
"workflowId": { "type": "string", "required": True }
"control": {"type": "string", "required": False},
"runId": {"type": "string", "required": False},
"workflowId": {"type": "string", "required": True}
},
"scheduleActivityTaskDecisionAttributes": {
"activityId": { "type": "string", "required": True },
"activityType": { "type": "ActivityType", "required": True },
"control": { "type": "string", "required": False },
"heartbeatTimeout": { "type": "string", "required": False },
"input": { "type": "string", "required": False },
"scheduleToCloseTimeout": { "type": "string", "required": False },
"scheduleToStartTimeout": { "type": "string", "required": False },
"startToCloseTimeout": { "type": "string", "required": False },
"taskList": { "type": "TaskList", "required": False },
"taskPriority": { "type": "string", "required": False }
"activityId": {"type": "string", "required": True},
"activityType": {"type": "ActivityType", "required": True},
"control": {"type": "string", "required": False},
"heartbeatTimeout": {"type": "string", "required": False},
"input": {"type": "string", "required": False},
"scheduleToCloseTimeout": {"type": "string", "required": False},
"scheduleToStartTimeout": {"type": "string", "required": False},
"startToCloseTimeout": {"type": "string", "required": False},
"taskList": {"type": "TaskList", "required": False},
"taskPriority": {"type": "string", "required": False}
},
"scheduleLambdaFunctionDecisionAttributes": {
"id": { "type": "string", "required": True },
"input": { "type": "string", "required": False },
"name": { "type": "string", "required": True },
"startToCloseTimeout": { "type": "string", "required": False }
"id": {"type": "string", "required": True},
"input": {"type": "string", "required": False},
"name": {"type": "string", "required": True},
"startToCloseTimeout": {"type": "string", "required": False}
},
"signalExternalWorkflowExecutionDecisionAttributes": {
"control": { "type": "string", "required": False },
"input": { "type": "string", "required": False },
"runId": { "type": "string", "required": False },
"signalName": { "type": "string", "required": True },
"workflowId": { "type": "string", "required": True }
"control": {"type": "string", "required": False},
"input": {"type": "string", "required": False},
"runId": {"type": "string", "required": False},
"signalName": {"type": "string", "required": True},
"workflowId": {"type": "string", "required": True}
},
"startChildWorkflowExecutionDecisionAttributes": {
"childPolicy": { "type": "string", "required": False },
"control": { "type": "string", "required": False },
"executionStartToCloseTimeout": { "type": "string", "required": False },
"input": { "type": "string", "required": False },
"lambdaRole": { "type": "string", "required": False },
"tagList": { "type": "string", "array": True, "required": False },
"taskList": { "type": "TaskList", "required": False },
"taskPriority": { "type": "string", "required": False },
"taskStartToCloseTimeout": { "type": "string", "required": False },
"workflowId": { "type": "string", "required": True },
"workflowType": { "type": "WorkflowType", "required": True }
"childPolicy": {"type": "string", "required": False},
"control": {"type": "string", "required": False},
"executionStartToCloseTimeout": {"type": "string", "required": False},
"input": {"type": "string", "required": False},
"lambdaRole": {"type": "string", "required": False},
"tagList": {"type": "string", "array": True, "required": False},
"taskList": {"type": "TaskList", "required": False},
"taskPriority": {"type": "string", "required": False},
"taskStartToCloseTimeout": {"type": "string", "required": False},
"workflowId": {"type": "string", "required": True},
"workflowType": {"type": "WorkflowType", "required": True}
},
"startTimerDecisionAttributes": {
"control": { "type": "string", "required": False },
"startToFireTimeout": { "type": "string", "required": True },
"timerId": { "type": "string", "required": True }
"control": {"type": "string", "required": False},
"startToFireTimeout": {"type": "string", "required": True},
"timerId": {"type": "string", "required": True}
}
}

View file

@ -98,13 +98,13 @@ class SWFDecisionValidationException(SWFClientError):
for pb in problems:
if pb["type"] == "null_value":
messages.append(
"Value null at '%(where)s' failed to satisfy constraint: "\
"Value null at '%(where)s' failed to satisfy constraint: "
"Member must not be null" % pb
)
elif pb["type"] == "bad_decision_type":
messages.append(
"Value '%(value)s' at '%(where)s' failed to satisfy constraint: " \
"Member must satisfy enum value set: " \
"Value '%(value)s' at '%(where)s' failed to satisfy constraint: "
"Member must satisfy enum value set: "
"[%(possible_values)s]" % pb
)
else:

View file

@ -1,5 +1,4 @@
from __future__ import unicode_literals
import six
import boto.swf

View file

@ -92,7 +92,7 @@ class Domain(object):
if not wfe and raise_if_none:
if run_id:
args = ["execution", "WorkflowExecution=[workflowId={0}, runId={1}]".format(
workflow_id, run_id)]
workflow_id, run_id)]
else:
args = ["execution, workflowId = {0}".format(workflow_id)]
raise SWFUnknownResourceFault(*args)
@ -100,7 +100,7 @@ class Domain(object):
return wfe
def add_to_activity_task_list(self, task_list, obj):
if not task_list in self.activity_task_lists:
if task_list not in self.activity_task_lists:
self.activity_task_lists[task_list] = []
self.activity_task_lists[task_list].append(obj)
@ -112,7 +112,7 @@ class Domain(object):
return _all
def add_to_decision_task_list(self, task_list, obj):
if not task_list in self.decision_task_lists:
if task_list not in self.decision_task_lists:
self.decision_task_lists[task_list] = []
self.decision_task_lists[task_list].append(obj)

View file

@ -2,8 +2,6 @@ import json
import six
from moto.core.responses import BaseResponse
from werkzeug.exceptions import HTTPException
from moto.core.utils import camelcase_to_underscores, method_names_from_class
from .exceptions import SWFSerializationException
from .models import swf_backends
@ -90,14 +88,14 @@ class SWFResponse(BaseResponse):
self._check_string(retention)
self._check_string(name)
self._check_none_or_string(description)
domain = self.swf_backend.register_domain(name, retention,
description=description)
self.swf_backend.register_domain(name, retention,
description=description)
return ""
def deprecate_domain(self):
name = self._params["name"]
self._check_string(name)
domain = self.swf_backend.deprecate_domain(name)
self.swf_backend.deprecate_domain(name)
return ""
def describe_domain(self):
@ -136,7 +134,7 @@ class SWFResponse(BaseResponse):
self._check_none_or_string(description)
# TODO: add defaultTaskPriority when boto gets to support it
activity_type = self.swf_backend.register_type(
self.swf_backend.register_type(
"activity", domain, name, version, task_list=task_list,
default_task_heartbeat_timeout=default_task_heartbeat_timeout,
default_task_schedule_to_close_timeout=default_task_schedule_to_close_timeout,
@ -180,7 +178,7 @@ class SWFResponse(BaseResponse):
# TODO: add defaultTaskPriority when boto gets to support it
# TODO: add defaultLambdaRole when boto gets to support it
workflow_type = self.swf_backend.register_type(
self.swf_backend.register_type(
"workflow", domain, name, version, task_list=task_list,
default_child_policy=default_child_policy,
default_task_start_to_close_timeout=default_task_start_to_close_timeout,