snappy config does not work from stdin
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| | Snappy |
Critical
|
Unassigned | ||
Bug Description
snappy config --help says:
"The configuration is a YAML file, provided in the specified file which can be "-" for stdin."
But:
$ snappy config ubuntu-core -
Just ignores the "-" and goes on displaying the config.
| Michał Sawicz (saviq) wrote : | #1 |
try “snappy config ubuntu-core -- -”.
On 8 July 2015 at 22:20, Michał Sawicz <email address hidden> wrote:
> Public bug reported:
>
> snappy config --help says:
>
> "The configuration is a YAML file, provided in the specified file which
> can be "-" for stdin."
>
> But:
>
> $ snappy config ubuntu-core -
>
> Just ignores the "-" and goes on displaying the config.
>
> ** Affects: snappy
> Importance: Undecided
> Status: New
>
> --
> You received this bug notification because you are a member of Snappy
> Developers, which is subscribed to Snappy.
> https:/
>
> Title:
> snappy config does not work from stdin
>
> To manage notifications about this bug go to:
> https:/
| Michał Sawicz (saviq) wrote : | #3 |
How'd you come up with that? ;)
Something needs fixing - either docs or implementation.
standard "end of flags" flag?
On 10 July 2015 at 00:47, Michał Sawicz <email address hidden> wrote:
> How'd you come up with that? ;)
>
> Something needs fixing - either docs or implementation.
>
> --
> You received this bug notification because you are a member of Snappy
> Developers, which is subscribed to Snappy.
> https:/
>
> Title:
> snappy config does not work from stdin
>
> To manage notifications about this bug go to:
> https:/
| Michał Sawicz (saviq) wrote : | #5 |
W dniu 10.07.2015 o 11:07, John Lenton pisze:
> standard "end of flags" flag?
Sure, I get that, but is this actually appropriate here? --help says
that "-" can be used in place of a file name, and it can – when piping
stdin. I just mean that even if what you wrote is working, it's not
documented, and not intuitive. Usually when you can use "-" in place of
stdin, it will work with either piping or console input. With no -- in
between.
| John Lenton (chipaca) wrote : | #6 |
I wasn't challenging the bug; the bug is real. But you asked me how I came up with the fact that -- - works... :-)
| Changed in snappy: | |
| status: | New → Triaged |
| importance: | Undecided → Critical |
| tags: | added: snappy-robustness |
| tags: | removed: snappy-robustness |
| Leo Arias (elopio) wrote : | #7 |
This seems to be working now:
ubuntu@localhost:~$ snappy config ubuntu-core -
config:
ubuntu-core:
timezone: Europe/Berlin
unable to create /etc/localtime: open /etc/localtime: read-only file system
ubuntu@localhost:~$ snappy config ubuntu-core
config:
ubuntu-core:
autoupdate: false
timezone: Etc/UTC
[...]
Of course, there's a bug in there, but we can track that in #1472802.
| Changed in snappy: | |
| status: | Triaged → Fix Released |


Apparently piping into the command works, it just doesn't wait for typing:
$ snappy config ubuntu-core localdomain
config:
ubuntu-core:
autopilot: false
timezone: UTC
hostname: localhost.
$ snappy config ubuntu-core - <(echo -e 'config:\n ubuntu-core:\n timezone: Europe/Berlin\n') localdomain
config:
ubuntu-core:
autopilot: false
timezone: Europe/Berlin
hostname: localhost.
Whether that's a bug, issue in the documentation, or PEBKAC, I'll leave to you.