Support config.d directory
Bug #1373467 reported by
James Hunt
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ubuntu system image |
Fix Released
|
High
|
Barry Warsaw |
Bug Description
Currently, the system-image package requires system-
However, to allow system-image to be used on systems other than Touch, it would be useful to have the ability to specify an alternate client.ini. Maybe splitting client.ini out of system-image-common into its own package which could provide
/etc/
or similar?
Related branches
lp://staging/~barry/ubuntu-system-image/lp1373467
- Registry Administrators: Pending requested
-
Diff: 8905 lines (+4167/-1538)90 files modified.bzrignore (+2/-0)
cli-manpage.rst (+13/-14)
dbus-manpage.rst (+14/-14)
ini-manpage.rst (+25/-24)
systemimage/api.py (+0/-5)
systemimage/config.py (+141/-99)
systemimage/data/client.ini (+0/-35)
systemimage/dbus.py (+2/-2)
systemimage/helpers.py (+34/-24)
systemimage/keyring.py (+2/-2)
systemimage/main.py (+5/-13)
systemimage/scores.py (+1/-0)
systemimage/service.py (+5/-11)
systemimage/state.py (+18/-15)
systemimage/testing/controller.py (+7/-6)
systemimage/testing/dbus.py (+1/-0)
systemimage/testing/helpers.py (+109/-52)
systemimage/testing/nose.py (+6/-1)
systemimage/tests/data/00.ini (+0/-1)
systemimage/tests/data/01.ini (+0/-1)
systemimage/tests/data/api.channels_01.json (+13/-0)
systemimage/tests/data/api.index_01.json (+36/-0)
systemimage/tests/data/api.index_02.json (+251/-0)
systemimage/tests/data/candidates.index_01.json (+6/-0)
systemimage/tests/data/candidates.index_02.json (+23/-0)
systemimage/tests/data/candidates.index_08.json (+244/-0)
systemimage/tests/data/candidates.index_10.json (+36/-0)
systemimage/tests/data/candidates.index_11.json (+37/-0)
systemimage/tests/data/candidates.index_13.json (+244/-0)
systemimage/tests/data/channel.channels_01.json (+23/-0)
systemimage/tests/data/channel.channels_02.json (+38/-0)
systemimage/tests/data/channel.channels_03.json (+70/-0)
systemimage/tests/data/channel.channels_04.json (+56/-0)
systemimage/tests/data/channel.channels_05.json (+23/-0)
systemimage/tests/data/channel_06.ini (+0/-8)
systemimage/tests/data/channel_07.ini (+0/-8)
systemimage/tests/data/config.config_01.ini (+34/-0)
systemimage/tests/data/config.config_02.ini (+2/-3)
systemimage/tests/data/config.config_03.ini (+2/-3)
systemimage/tests/data/config.config_04.ini (+36/-0)
systemimage/tests/data/config.config_05.ini (+2/-3)
systemimage/tests/data/config.config_06.ini (+2/-3)
systemimage/tests/data/config.config_07.ini (+0/-1)
systemimage/tests/data/config.config_08.ini (+0/-1)
systemimage/tests/data/config.config_09.ini (+0/-3)
systemimage/tests/data/config.config_10.ini (+2/-2)
systemimage/tests/data/config_04.ini (+0/-36)
systemimage/tests/data/dbus.index_03.json (+36/-0)
systemimage/tests/data/download.index_01.json (+6/-0)
systemimage/tests/data/gpg.channels_01.json (+23/-0)
systemimage/tests/data/helpers.config_01.ini (+7/-0)
systemimage/tests/data/helpers.config_02.ini (+6/-0)
systemimage/tests/data/index.channels_01.json (+9/-0)
systemimage/tests/data/index.channels_02.json (+13/-0)
systemimage/tests/data/index.channels_05.json (+9/-0)
systemimage/tests/data/index.index_01.json (+251/-0)
systemimage/tests/data/index.index_04.json (+244/-0)
systemimage/tests/data/index_26.json (+0/-245)
systemimage/tests/data/main.channels_01.json (+13/-0)
systemimage/tests/data/main.channels_03.json (+13/-0)
systemimage/tests/data/main.config_01.ini (+3/-4)
systemimage/tests/data/main.config_05.ini (+7/-0)
systemimage/tests/data/main.config_07.ini (+1/-1)
systemimage/tests/data/main.index_04.json (+36/-0)
systemimage/tests/data/main.index_05.json (+36/-0)
systemimage/tests/data/scores.index_01.json (+245/-0)
systemimage/tests/data/scores.index_05.json (+245/-0)
systemimage/tests/data/state.channel_01.ini (+6/-0)
systemimage/tests/data/state.channels_01.json (+64/-0)
systemimage/tests/data/state.channels_02.json (+13/-0)
systemimage/tests/data/state.index_01.json (+244/-0)
systemimage/tests/data/state.index_02.json (+245/-0)
systemimage/tests/data/state.index_03.json (+36/-0)
systemimage/tests/data/state.index_04.json (+37/-0)
systemimage/tests/test_api.py (+20/-13)
systemimage/tests/test_candidates.py (+20/-20)
systemimage/tests/test_channel.py (+18/-18)
systemimage/tests/test_config.py (+117/-170)
systemimage/tests/test_dbus.py (+88/-121)
systemimage/tests/test_download.py (+31/-32)
systemimage/tests/test_gpg.py (+12/-12)
systemimage/tests/test_helpers.py (+110/-128)
systemimage/tests/test_index.py (+31/-25)
systemimage/tests/test_main.py (+203/-267)
systemimage/tests/test_scores.py (+10/-10)
systemimage/tests/test_settings.py (+2/-5)
systemimage/tests/test_state.py (+71/-58)
systemimage/tests/test_winner.py (+21/-17)
tools/demo.ini (+0/-1)
tools/mkvenv.py (+0/-1)
lp://staging/~barry/ubuntu-system-image/citrain30
- Ubuntu CI managed package branches: Pending requested
-
Diff: 15774 lines (+8086/-2651)138 files modifiedMANIFEST.in (+1/-1)
NEWS.rst (+72/-1)
PKG-INFO (+1/-1)
cli-manpage.rst (+31/-18)
coverage-curl.ini (+21/-0)
coverage-udm.ini (+21/-0)
coverage.ini (+0/-15)
dbus-manpage.rst (+50/-28)
debian/changelog (+77/-0)
debian/control (+3/-2)
debian/rules (+15/-10)
debian/tests/control (+7/-7)
debian/tests/dryrun (+1/-1)
debian/tests/prep.py (+9/-2)
debian/tests/smoketest (+2/-2)
debian/tests/smoketest-noreboot (+2/-2)
debian/tests/unittests (+1/-1)
ini-manpage.rst (+33/-30)
setup.cfg (+1/-1)
setup.py (+1/-1)
system_image.egg-info/PKG-INFO (+1/-1)
system_image.egg-info/SOURCES.txt (+105/-59)
systemimage/api.py (+20/-10)
systemimage/apply.py (+32/-9)
systemimage/bag.py (+7/-1)
systemimage/candidates.py (+1/-1)
systemimage/channel.py (+1/-1)
systemimage/config.py (+174/-108)
systemimage/curl.py (+275/-0)
systemimage/data/client.ini (+0/-35)
systemimage/dbus.py (+100/-95)
systemimage/device.py (+1/-1)
systemimage/docs/conf.py (+1/-1)
systemimage/download.py (+119/-208)
systemimage/gpg.py (+6/-1)
systemimage/helpers.py (+53/-43)
systemimage/image.py (+5/-1)
systemimage/index.py (+2/-5)
systemimage/keyring.py (+5/-5)
systemimage/logging.py (+4/-2)
systemimage/main.py (+117/-47)
systemimage/reactor.py (+7/-4)
systemimage/scores.py (+32/-15)
systemimage/service.py (+15/-18)
systemimage/settings.py (+1/-1)
systemimage/state.py (+32/-23)
systemimage/testing/controller.py (+95/-45)
systemimage/testing/dbus.py (+22/-10)
systemimage/testing/demo.py (+6/-6)
systemimage/testing/helpers.py (+174/-62)
systemimage/testing/nose.py (+7/-2)
systemimage/testing/service.py (+0/-50)
systemimage/tests/data/00.ini (+1/-2)
systemimage/tests/data/01.ini (+2/-3)
systemimage/tests/data/api.channels_01.json (+13/-0)
systemimage/tests/data/api.index_01.json (+36/-0)
systemimage/tests/data/api.index_02.json (+251/-0)
systemimage/tests/data/api.index_03.json (+37/-0)
systemimage/tests/data/candidates.index_01.json (+6/-0)
systemimage/tests/data/candidates.index_02.json (+23/-0)
systemimage/tests/data/candidates.index_08.json (+244/-0)
systemimage/tests/data/candidates.index_10.json (+36/-0)
systemimage/tests/data/candidates.index_11.json (+37/-0)
systemimage/tests/data/candidates.index_13.json (+244/-0)
systemimage/tests/data/channel.channels_01.json (+23/-0)
systemimage/tests/data/channel.channels_02.json (+38/-0)
systemimage/tests/data/channel.channels_03.json (+70/-0)
systemimage/tests/data/channel.channels_04.json (+56/-0)
systemimage/tests/data/channel.channels_05.json (+23/-0)
systemimage/tests/data/channel_06.ini (+0/-8)
systemimage/tests/data/channel_07.ini (+0/-8)
systemimage/tests/data/config.config_01.ini (+34/-0)
systemimage/tests/data/config.config_02.ini (+34/-0)
systemimage/tests/data/config.config_03.ini (+3/-4)
systemimage/tests/data/config.config_04.ini (+36/-0)
systemimage/tests/data/config.config_05.ini (+3/-4)
systemimage/tests/data/config.config_06.ini (+3/-4)
systemimage/tests/data/config.config_07.ini (+1/-2)
systemimage/tests/data/config.config_08.ini (+1/-2)
systemimage/tests/data/config.config_09.ini (+0/-3)
systemimage/tests/data/config.config_10.ini (+27/-0)
systemimage/tests/data/config.config_11.ini (+2/-0)
systemimage/tests/data/config_04.ini (+0/-36)
systemimage/tests/data/config_09.ini (+0/-27)
systemimage/tests/data/config_10.ini (+0/-35)
systemimage/tests/data/dbus.index_03.json (+36/-0)
systemimage/tests/data/dbus.index_06.json (+37/-0)
systemimage/tests/data/download.index_01.json (+6/-0)
systemimage/tests/data/gpg.channels_01.json (+23/-0)
systemimage/tests/data/helpers.config_01.ini (+7/-0)
systemimage/tests/data/helpers.config_02.ini (+6/-0)
systemimage/tests/data/index.channels_01.json (+9/-0)
systemimage/tests/data/index.channels_02.json (+13/-0)
systemimage/tests/data/index.channels_05.json (+9/-0)
systemimage/tests/data/index.index_01.json (+251/-0)
systemimage/tests/data/index.index_04.json (+244/-0)
systemimage/tests/data/main.channels_01.json (+13/-0)
systemimage/tests/data/main.channels_03.json (+13/-0)
systemimage/tests/data/main.config_01.ini (+5/-6)
systemimage/tests/data/main.config_05.ini (+7/-0)
systemimage/tests/data/main.config_07.ini (+1/-1)
systemimage/tests/data/main.index_04.json (+36/-0)
systemimage/tests/data/main.index_05.json (+36/-0)
systemimage/tests/data/scores.index_01.json (+245/-0)
systemimage/tests/data/scores.index_05.json (+245/-0)
systemimage/tests/data/scores.index_06.json (+253/-0)
systemimage/tests/data/scores.index_07.json (+252/-0)
systemimage/tests/data/state.channels_01.json (+64/-0)
systemimage/tests/data/state.channels_02.json (+13/-0)
systemimage/tests/data/state.config_01.ini (+2/-0)
systemimage/tests/data/state.config_02.ini (+6/-0)
systemimage/tests/data/state.index_01.json (+244/-0)
systemimage/tests/data/state.index_02.json (+245/-0)
systemimage/tests/data/state.index_03.json (+36/-0)
systemimage/tests/data/state.index_04.json (+37/-0)
systemimage/tests/data/state.index_07.json (+2/-3)
systemimage/tests/test_api.py (+71/-93)
systemimage/tests/test_bag.py (+1/-1)
systemimage/tests/test_candidates.py (+37/-45)
systemimage/tests/test_channel.py (+19/-19)
systemimage/tests/test_config.py (+202/-178)
systemimage/tests/test_dbus.py (+365/-167)
systemimage/tests/test_download.py (+229/-115)
systemimage/tests/test_gpg.py (+129/-19)
systemimage/tests/test_helpers.py (+183/-171)
systemimage/tests/test_image.py (+1/-1)
systemimage/tests/test_index.py (+32/-68)
systemimage/tests/test_keyring.py (+1/-1)
systemimage/tests/test_main.py (+725/-432)
systemimage/tests/test_scores.py (+127/-15)
systemimage/tests/test_settings.py (+4/-6)
systemimage/tests/test_state.py (+244/-142)
systemimage/tests/test_winner.py (+23/-19)
systemimage/udm.py (+212/-0)
systemimage/version.txt (+1/-1)
tools/demo.ini (+0/-1)
tools/runme.sh (+10/-0)
tox.ini (+21/-16)
no longer affects: | system-image (Ubuntu) |
tags: | added: client |
Changed in ubuntu-system-image: | |
status: | New → Triaged |
Changed in ubuntu-system-image: | |
milestone: | none → 2.5 |
Changed in ubuntu-system-image: | |
importance: | Undecided → High |
assignee: | nobody → Barry Warsaw (barry) |
Changed in ubuntu-system-image: | |
milestone: | 2.5 → 3.0 |
summary: |
- Ability to specify alternate client.ini + Support config.d directory |
Changed in ubuntu-system-image: | |
status: | In Progress → Fix Committed |
Changed in ubuntu-system-image: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Here's some thinking on the idea. Rather than completely obsolete client.ini and channel.ini, I'm thinking about the following rules:
1) /etc/system- image/client. ini is loaded first if it exists
2) /etc/system- image/config. d/ is scanned for files ending in .ini or .cfg, and sorted alphanumerically by file name
3) the matching, sorted config.d/ files are loaded, and can override anything in client.ini
4) /etc/system- image/channel. ini is loaded, which currently allows overriding only the [service] section.
Now, questions:
* Should we retain /etc/system- image/client. ini or just move all ini files to config.d? If we move it, it should probably be named /etc/system- image/config. d/00_default. ini.
* Should we keep the --config/-C option? Right now it names an alternative client.ini file and this is used by the test suite among other use cases. Maybe we should just change this so that it names the config.d/ directory.
* If we keep the default client.ini location, should we allow it to specify where it's config.d/ directory is?
* Should we keep channel.ini? We could theoretically just move it to config.d/ and name it something like 01_channel.ini.
* Should we lift the override restriction on channel.ini and just treat that file the same as all the others, i.e. allowing it to override any setting in any section? This will require coordination with image builds since channel.ini is generated by that process. If we move it we might need a transition period.
* Is alphanumeric sorting good enough? An alternative is to require a regexp like (?P<order> \d+)_[. *].(cfg| ini) and sort only on the int() conversion of 'order'.
I'm pretty sure I can do the simple cases with just the stdlib configparser. Another implementation choice might be lazr.config, which has some very nice properties, but isn't even in main, and I'm reluctant to do a MIR for it unless it's really necessary. (Side note, I've been thinking about pulling some of the nicer features of lazr.config into the stdlib for Python 3.5.)
I may have more questions once I start to implement this. I'm really tempted to replace client.ini and channel.ini and lift the override restrictions.