`plainbox session export` doesn't work anymore
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
PlainBox (Toolkit) |
Fix Released
|
High
|
Maciej Kisielewski |
Bug Description
With latest plainbox in stable PPA as well as current version in master, although we can get the list of available exporters:
$ plainbox session export -f ? somerville-
Available output formats: 2013.com.
We cannot use them:
$ plainbox session export -f text somerville-
usage: plainbox session export [-h] [--flag FLAG] [-f FORMAT] [-p OPTIONS]
plainbox session export: error: argument -f/--output-format: invalid choice: 'text' (choose from '?')
$ plainbox session export -f "2013.com.
usage: plainbox session export [-h] [--flag FLAG] [-f FORMAT] [-p OPTIONS]
plainbox session export: error: argument -f/--output-format: invalid choice: '2013.com.
$ plainbox session export -f xml somerville-
usage: plainbox session export [-h] [--flag FLAG] [-f FORMAT] [-p OPTIONS]
plainbox session export: error: argument -f/--output-format: invalid choice: 'xml' (choose from '?')
Changed in plainbox: | |
status: | New → In Progress |
importance: | Undecided → High |
assignee: | nobody → Maciej Kisielewski (kissiel) |
milestone: | none → future |
milestone: | future → 0.33.0 |
Changed in plainbox: | |
status: | In Progress → Fix Committed |
Changed in plainbox: | |
status: | Fix Committed → Fix Released |
The problem was introduced with my "commands: cmd_session: don't get_exporter_ names() when not needed" 84e3b2c96566df7 322a2dd661c260b 60604b55bc.
For each subcommand that we have in plainbox we have split them to (at least) two files. cmd_* and inv_*. The former having the declaration of arg and its options and the latter having the implementation. This ensures that every module that invocation needs is only loaded when we invoke the command.
With my 84e3b2 patch I removed checking of all available exporters in the cmd_ phase. This led to a plainbox starting up 4x faster. I left '?' as the only possible value of --output-format, and when invoked with that arg, it would actually pull all exporters from providers and list them, as it would run through the inv_ phase.