diff options
Diffstat (limited to 'bitbake/lib/bb/tinfoil.py')
-rw-r--r-- | bitbake/lib/bb/tinfoil.py | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/bitbake/lib/bb/tinfoil.py b/bitbake/lib/bb/tinfoil.py index 8c9b6b8ca5..8bec8cbaf6 100644 --- a/bitbake/lib/bb/tinfoil.py +++ b/bitbake/lib/bb/tinfoil.py | |||
@@ -53,6 +53,10 @@ class TinfoilDataStoreConnectorVarHistory: | |||
53 | def remoteCommand(self, cmd, *args, **kwargs): | 53 | def remoteCommand(self, cmd, *args, **kwargs): |
54 | return self.tinfoil.run_command('dataStoreConnectorVarHistCmd', self.dsindex, cmd, args, kwargs) | 54 | return self.tinfoil.run_command('dataStoreConnectorVarHistCmd', self.dsindex, cmd, args, kwargs) |
55 | 55 | ||
56 | def emit(self, var, oval, val, o, d): | ||
57 | ret = self.tinfoil.run_command('dataStoreConnectorVarHistCmdEmit', self.dsindex, var, oval, val, d.dsindex) | ||
58 | o.write(ret) | ||
59 | |||
56 | def __getattr__(self, name): | 60 | def __getattr__(self, name): |
57 | if not hasattr(bb.data_smart.VariableHistory, name): | 61 | if not hasattr(bb.data_smart.VariableHistory, name): |
58 | raise AttributeError("VariableHistory has no such method %s" % name) | 62 | raise AttributeError("VariableHistory has no such method %s" % name) |
@@ -448,7 +452,7 @@ class Tinfoil: | |||
448 | self.run_actions(config_params) | 452 | self.run_actions(config_params) |
449 | self.recipes_parsed = True | 453 | self.recipes_parsed = True |
450 | 454 | ||
451 | def run_command(self, command, *params): | 455 | def run_command(self, command, *params, handle_events=True): |
452 | """ | 456 | """ |
453 | Run a command on the server (as implemented in bb.command). | 457 | Run a command on the server (as implemented in bb.command). |
454 | Note that there are two types of command - synchronous and | 458 | Note that there are two types of command - synchronous and |
@@ -465,7 +469,16 @@ class Tinfoil: | |||
465 | commandline = [command] | 469 | commandline = [command] |
466 | if params: | 470 | if params: |
467 | commandline.extend(params) | 471 | commandline.extend(params) |
468 | result = self.server_connection.connection.runCommand(commandline) | 472 | try: |
473 | result = self.server_connection.connection.runCommand(commandline) | ||
474 | finally: | ||
475 | while handle_events: | ||
476 | event = self.wait_event() | ||
477 | if not event: | ||
478 | break | ||
479 | if isinstance(event, logging.LogRecord): | ||
480 | if event.taskpid == 0 or event.levelno > logging.INFO: | ||
481 | self.logger.handle(event) | ||
469 | if result[1]: | 482 | if result[1]: |
470 | raise TinfoilCommandFailed(result[1]) | 483 | raise TinfoilCommandFailed(result[1]) |
471 | return result[0] | 484 | return result[0] |