Merge ~smoser/curtin:feature/subcommand-features into curtin:master

Proposed by Scott Moser
Status: Merged
Approved by: Scott Moser
Approved revision: 922e78315b010a3ac88d828a31fb0f557b53dbcf
Merge reported by: Server Team CI bot
Merged at revision: not available
Proposed branch: ~smoser/curtin:feature/subcommand-features
Merge into: curtin:master
Diff against target: 41 lines (+23/-3)
2 files modified
curtin/commands/features.py (+20/-0)
curtin/commands/main.py (+3/-3)
Reviewer Review Type Date Requested Status
Ryan Harper (community) Approve
Server Team CI bot continuous-integration Approve
Review via email: mp+352829@code.launchpad.net

Commit message

Add subcommand 'features'.

The 'features' subcommand just writes the curtin.FEATURES
to standard output, one per line.

Description of the change

see commit message

To post a comment you must log in.
Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ryan Harper (raharper) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/curtin/commands/features.py b/curtin/commands/features.py
2new file mode 100644
3index 0000000..0f6085b
4--- /dev/null
5+++ b/curtin/commands/features.py
6@@ -0,0 +1,20 @@
7+# This file is part of curtin. See LICENSE file for copyright and license info.
8+"""List the supported feature names to stdout."""
9+
10+import sys
11+from .. import FEATURES
12+from . import populate_one_subcmd
13+
14+CMD_ARGUMENTS = ((tuple()))
15+
16+
17+def features_main(args):
18+ sys.stdout.write("\n".join(sorted(FEATURES)) + "\n")
19+ sys.exit(0)
20+
21+
22+def POPULATE_SUBCMD(parser):
23+ populate_one_subcmd(parser, CMD_ARGUMENTS, features_main)
24+ parser.description = __doc__
25+
26+# vi: ts=4 expandtab syntax=python
27diff --git a/curtin/commands/main.py b/curtin/commands/main.py
28index 779bb03..bccfc51 100644
29--- a/curtin/commands/main.py
30+++ b/curtin/commands/main.py
31@@ -16,9 +16,9 @@ VERSIONSTR = version.version_string()
32 SUB_COMMAND_MODULES = [
33 'apply_net', 'apt-config', 'block-attach-iscsi', 'block-detach-iscsi',
34 'block-info', 'block-meta', 'block-wipe', 'clear-holders', 'curthooks',
35- 'collect-logs', 'extract', 'hook', 'install', 'mkfs', 'in-target',
36- 'net-meta', 'pack', 'swap', 'system-install', 'system-upgrade', 'unmount',
37- 'version',
38+ 'collect-logs', 'extract', 'features',
39+ 'hook', 'install', 'mkfs', 'in-target', 'net-meta', 'pack', 'swap',
40+ 'system-install', 'system-upgrade', 'unmount', 'version',
41 ]
42
43

Subscribers

People subscribed via source and target branches