diff options
author | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2017-07-26 14:12:35 +0100 |
---|---|---|
committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2017-07-26 14:12:35 +0100 |
commit | 98f01d66c37098e8c659feb9bc0c73332ca41cd1 (patch) | |
tree | 9c3a77c82f54484cdca1b0ae01a12642bdc3759d | |
parent | 21e805b60be7d67df4e49be27c92bf25e71a2884 (diff) | |
download | buildstream-98f01d66c37098e8c659feb9bc0c73332ca41cd1.tar.gz |
main.py: Dont handle build failures interactively when --on-error is specified
If --on-error is specified to decide the failure action on the command line,
then dont interactively handle that decision.
-rw-r--r-- | buildstream/_frontend/main.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/buildstream/_frontend/main.py b/buildstream/_frontend/main.py index 642a38d30..66b13c2be 100644 --- a/buildstream/_frontend/main.py +++ b/buildstream/_frontend/main.py @@ -576,6 +576,10 @@ class App(): else: self.interactive = self.is_a_tty + # Whether we handle failures interactively + # defaults to whether we are interactive or not. + self.interactive_failures = self.interactive + # Early enable messaging in debug mode if self.main_options['debug']: click.echo("DEBUG: Early enablement of messages") @@ -628,6 +632,12 @@ class App(): if option_value is not None: setattr(self.context, context_attr, option_value) + # Disable interactive failures if --on-error was specified + # on the command line, but not if it was only specified + # in the config. + if self.main_options.get('on_error') is not None: + self.interactive_failures = False + # Create the application's scheduler self.scheduler = Scheduler(self.context, interrupt_callback=self.interrupt_handler, @@ -766,7 +776,8 @@ class App(): def handle_failure(self, element, failure): # Handle non interactive mode setting of what to do when a job fails. - if not self.interactive: + if not self.interactive_failures: + if self.context.sched_error_action == 'terminate': self.scheduler.terminate_jobs() elif self.context.sched_error_action == 'quit': |