snappy config does not work from stdin

Bug #1472788 reported by Michał Sawicz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snappy
Fix Released
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.

Revision history for this message
Michał Sawicz (saviq) wrote :

Apparently piping into the command works, it just doesn't wait for typing:

$ snappy config ubuntu-core
config:
  ubuntu-core:
    autopilot: false
    timezone: UTC
    hostname: localhost.localdomain

$ snappy config ubuntu-core - <(echo -e 'config:\n ubuntu-core:\n timezone: Europe/Berlin\n')
config:
  ubuntu-core:
    autopilot: false
    timezone: Europe/Berlin
    hostname: localhost.localdomain

Whether that's a bug, issue in the documentation, or PEBKAC, I'll leave to you.

Revision history for this message
John Lenton (chipaca) wrote : Re: [Bug 1472788] [NEW] snappy config does not work from stdin

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://bugs.launchpad.net/bugs/1472788
>
> Title:
> snappy config does not work from stdin
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/snappy/+bug/1472788/+subscriptions

Revision history for this message
Michał Sawicz (saviq) wrote :

How'd you come up with that? ;)

Something needs fixing - either docs or implementation.

Revision history for this message
John Lenton (chipaca) wrote : Re: [Bug 1472788] Re: snappy config does not work from stdin

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://bugs.launchpad.net/bugs/1472788
>
> Title:
> snappy config does not work from stdin
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/snappy/+bug/1472788/+subscriptions

Revision history for this message
Michał Sawicz (saviq) wrote :

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.

Revision history for this message
John Lenton (chipaca) wrote :

I wasn't challenging the bug; the bug is real. But you asked me how I came up with the fact that -- - works... :-)

Michael Vogt (mvo)
Changed in snappy:
status: New → Triaged
importance: Undecided → Critical
Michael Vogt (mvo)
tags: added: snappy-robustness
tags: removed: snappy-robustness
Revision history for this message
Leo Arias (elopio) wrote :

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
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.