summaryrefslogtreecommitdiff
path: root/src/buildstream/_context.py
diff options
context:
space:
mode:
authorBenjamin Schubert <contact@benschubert.me>2019-07-26 16:06:03 +0100
committerBenjamin Schubert <contact@benschubert.me>2019-07-29 10:42:02 +0100
commitb632e471f1ca4764c15534006294f7dc0b842b69 (patch)
tree0b7a1782b8e7054ba2bfb05aeeedb6f0c1e26dd6 /src/buildstream/_context.py
parent0f074dd37524047cb53214be5c0f10436d3abb1d (diff)
downloadbuildstream-b632e471f1ca4764c15534006294f7dc0b842b69.tar.gz
context: Move scheduler actions to an Enum
Also add helpers for the cli to be able to represent 'FastEnum' directly
Diffstat (limited to 'src/buildstream/_context.py')
-rw-r--r--src/buildstream/_context.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/buildstream/_context.py b/src/buildstream/_context.py
index c18f9426d..4d68ef222 100644
--- a/src/buildstream/_context.py
+++ b/src/buildstream/_context.py
@@ -29,6 +29,7 @@ from ._platform import Platform
from ._artifactcache import ArtifactCache
from ._sourcecache import SourceCache
from ._cas import CASCache, CASQuota, CASCacheUsage
+from .types import _SchedulerErrorAction
from ._workspaces import Workspaces, WorkspaceProjectCache
from .node import Node
from .sandbox import SandboxRemote
@@ -323,8 +324,7 @@ class Context():
'on-error', 'fetchers', 'builders',
'pushers', 'network-retries'
])
- self.sched_error_action = _node_get_option_str(
- scheduler, 'on-error', ['continue', 'quit', 'terminate'])
+ self.sched_error_action = scheduler.get_enum('on-error', _SchedulerErrorAction)
self.sched_fetchers = scheduler.get_int('fetchers')
self.sched_builders = scheduler.get_int('builders')
self.sched_pushers = scheduler.get_int('pushers')