Merge lp:~kissiel/checkbox/fix-1568759-default-config-name into lp:checkbox

Proposed by Maciej Kisielewski
Status: Merged
Approved by: Maciej Kisielewski
Approved revision: 4303
Merged at revision: 4304
Proposed branch: lp:~kissiel/checkbox/fix-1568759-default-config-name
Merge into: lp:checkbox
Diff against target: 111 lines (+74/-1)
4 files modified
checkbox-ng/checkbox_ng/launcher.py (+1/-1)
checkbox-ng/docs/configs.rst (+46/-0)
checkbox-ng/docs/index.rst (+1/-0)
checkbox-ng/docs/launcher-tutorial.rst (+26/-0)
To merge this branch: bzr merge lp:~kissiel/checkbox/fix-1568759-default-config-name
Reviewer Review Type Date Requested Status
Paul Larson Approve
Review via email: mp+291756@code.launchpad.net

Description of the change

This MR cleans up the config files story.

Recommended read for anyone using checkbox-cli and/or launchers.

611a585 checkbox-ng:launchers: make checkbox.conf the default config name
67de921 checkbox-ng:docs: add configs' values resolution order doc
7c686a6 checkbox-ng:docs: mention configs in launcher tutorial

To post a comment you must log in.
Revision history for this message
Paul Larson (pwlars) wrote :

A few minor corrections and a suggestion. Otherwise, looks good.

review: Needs Fixing
4301. By Maciej Kisielewski

checkbox-ng:docs: make checkbox.conf the default config name

Signed-off-by: Maciej Kisielewski <email address hidden>

4302. By Maciej Kisielewski

checkbox-ng:docs: add configs' values resolution order doc

Signed-off-by: Maciej Kisielewski <email address hidden>

4303. By Maciej Kisielewski

checkbox-ng:docs: mention configs in launcher tutorial

Fixes: https://bugs.launchpad.net/plainbox/+bug/1568759

Signed-off-by: Maciej Kisielewski <email address hidden>

Revision history for this message
Maciej Kisielewski (kissiel) wrote :

Corrected, squashed, repushed.

Revision history for this message
Paul Larson (pwlars) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'checkbox-ng/checkbox_ng/launcher.py'
2--- checkbox-ng/checkbox_ng/launcher.py 2016-03-22 16:12:19 +0000
3+++ checkbox-ng/checkbox_ng/launcher.py 2016-04-13 14:41:08 +0000
4@@ -52,7 +52,7 @@
5
6 config_filename = config.Variable(
7 section="config",
8- default="canonical-certification.conf",
9+ default="checkbox.conf",
10 help_text=_("Name of custom configuration file"))
11
12 def get_concrete_launcher(self):
13
14=== added file 'checkbox-ng/docs/configs.rst'
15--- checkbox-ng/docs/configs.rst 1970-01-01 00:00:00 +0000
16+++ checkbox-ng/docs/configs.rst 2016-04-13 14:41:08 +0000
17@@ -0,0 +1,46 @@
18+Configuration values resolution order
19+=====================================
20+
21+The directories that are searched for config files are:
22+``/etc/xdg/``
23+``~/.config/``
24+
25+The filename that's looked up depends on how checkbox is run.
26+
27+Invoking ``checkbox-cli`` (without launcher)
28+--------------------------------------------
29+Assumed config file name is ``checkbox.conf``
30+
31+Invoking ``plainbox``
32+---------------------
33+Assumed config file name is ``plainbox.conf``
34+
35+Invoking launcher that uses 'the new syntax'
36+--------------------------------------------
37+The file name to look for is specified using ``config_filename`` variable from
38+launcher, from the ``[config]`` section. If it's not present, ``checkbox.conf``
39+' is used.
40+
41+Invoking 'legacy' launcher
42+--------------------------
43+Both, ``plainbox.conf`` and the value ``config_filename`` from launcher are used.
44+
45+Apps using SessionAssistant or the plainbox internals directly
46+-----------------------------------------------------------
47+``plainbox.conf`` is used, unless
48+``SessionAsistant.use_alternate_configuration()`` is called.
49+
50+Note that if same configuration variable is defined in more then one place, the
51+value resolution is as follows:
52+ 1. launcher being invoked (only the new syntax launchers)
53+ 2. config file from ``~/.config``
54+ 3. config file from ``/etc/xdg``
55+
56+For legacy launchers, because two config filenames can be used (the one defined
57+in ``config_filename``, and ``plainbox.conf``), the one from
58+``config_filename`` takes precedence over plainbox.conf. I.e. the order of
59+preference is (most important first):
60+ 1. ``~/.config/checkbox.conf``
61+ 2. ``~/.config/plainbox.conf``
62+ 3. ``/etc/xdg/checkbox.conf``
63+ 4. ``/etc/xdg/plainbox.conf``
64
65=== modified file 'checkbox-ng/docs/index.rst'
66--- checkbox-ng/docs/index.rst 2014-09-16 12:53:41 +0000
67+++ checkbox-ng/docs/index.rst 2016-04-13 14:41:08 +0000
68@@ -58,6 +58,7 @@
69 scripts/index.rst
70 profiles.rst
71 launcher-tutorial.rst
72+ configs.rst
73 release.rst
74
75 Indices and tables
76
77=== modified file 'checkbox-ng/docs/launcher-tutorial.rst'
78--- checkbox-ng/docs/launcher-tutorial.rst 2016-03-22 16:24:13 +0000
79+++ checkbox-ng/docs/launcher-tutorial.rst 2016-04-13 14:41:08 +0000
80@@ -13,6 +13,32 @@
81
82 This tutorial describes Launchers version 1.
83
84+External configuration files
85+============================
86+
87+Launcher can specify external file(s) to load values from.
88+
89+``[config]``
90+
91+Beginning of the configuration section.
92+
93+``config_filename``
94+
95+Name of the configuration file to look for. Default value: ``checkbox.conf``
96+
97+The directories that will be searched for the file are ``/etc/xdg/`` and
98+``~/config/``.
99+
100+Example::
101+
102+ [config]
103+ config_filename = testing.conf
104+
105+This will make checkbox look for ``/etc/xdg/testing.conf`` and
106+``~/config/testing.conf`` files.
107+
108+For more details about value resolution order see :doc:`configs</configs>`
109+
110 Launcher meta-information
111 =========================
112

Subscribers

People subscribed via source and target branches