Merge lp:~kissiel/checkbox/add-config-to-cbt into lp:checkbox

Proposed by Maciej Kisielewski
Status: Merged
Approved by: Zygmunt Krynicki
Approved revision: 3578
Merged at revision: 3578
Proposed branch: lp:~kissiel/checkbox/add-config-to-cbt
Merge into: lp:checkbox
Diff against target: 36 lines (+4/-1)
1 file modified
checkbox-touch/py/checkbox_touch.py (+4/-1)
To merge this branch: bzr merge lp:~kissiel/checkbox/add-config-to-cbt
Reviewer Review Type Date Requested Status
Zygmunt Krynicki (community) Approve
Review via email: mp+249455@code.launchpad.net

Description of the change

This MR makes Checkbox-Touch keep PlainBoxConfig instance and use it when running job activities.

311fe1d checkbox-touch: use PlainBoxConfig when running jobs

To post a comment you must log in.
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

+1, thanks

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'checkbox-touch/py/checkbox_touch.py'
--- checkbox-touch/py/checkbox_touch.py 2015-02-09 14:38:01 +0000
+++ checkbox-touch/py/checkbox_touch.py 2015-02-12 08:37:20 +0000
@@ -44,6 +44,7 @@
4444
45from plainbox.abc import IJobResult45from plainbox.abc import IJobResult
46from plainbox.i18n import gettext as _46from plainbox.i18n import gettext as _
47from plainbox.impl.applogic import PlainBoxConfig
47from plainbox.impl.clitools import ToolBase48from plainbox.impl.clitools import ToolBase
48from plainbox.impl.exporter import get_all_exporters49from plainbox.impl.exporter import get_all_exporters
49from plainbox.impl.providers.special import get_categories50from plainbox.impl.providers.special import get_categories
@@ -335,6 +336,7 @@
335 self.resume_candidate_storage = None336 self.resume_candidate_storage = None
336 self.session_storage_repo = None337 self.session_storage_repo = None
337 self.timestamp = datetime.datetime.utcnow().isoformat()338 self.timestamp = datetime.datetime.utcnow().isoformat()
339 self.config = None
338340
339 def __repr__(self):341 def __repr__(self):
340 return "app"342 return "app"
@@ -366,6 +368,7 @@
366 self.context.state.metadata.flags.add('bootstrapping')368 self.context.state.metadata.flags.add('bootstrapping')
367 # Checkpoint the session so that we have something to see369 # Checkpoint the session so that we have something to see
368 self._checkpoint()370 self._checkpoint()
371 self.config = PlainBoxConfig()
369 self.runner = JobRunner(372 self.runner = JobRunner(
370 self.manager.storage.location,373 self.manager.storage.location,
371 self.context.provider_list,374 self.context.provider_list,
@@ -642,7 +645,7 @@
642 self.context.state.running_job_name = job_id645 self.context.state.running_job_name = job_id
643 self._checkpoint()646 self._checkpoint()
644 try:647 try:
645 result = self.runner.run_job(job, job_state)648 result = self.runner.run_job(job, job_state, self.config)
646 except OSError as exc:649 except OSError as exc:
647 result = self.context.state.job_state_map[job_id].result650 result = self.context.state.job_state_map[job_id].result
648 result.outcome = 'fail'651 result.outcome = 'fail'

Subscribers

People subscribed via source and target branches