inconsistency between 'snap interfaces' and 'snap connect/disconnect'

Bug #1578287 reported by Jamie Strandboge
22
This bug affects 5 people
Affects Status Importance Assigned to Milestone
snapd
Confirmed
Low
Unassigned

Bug Description

I was trying to manually connect a snap the other day and noticed that there is a small inconsistency between 'snap interfaces' output and the 'snap connect' command. Eg,

$ snap interfaces
Slot Plug
...
:log-observe snappy-debug
...

Notice how in the snap interfaces output, it is 'slots then plugs'. However, to connect a snap the command line argument ordering is reversed:
$ snap connect
error: the required arguments `<snap>:<plug>` and `<snap>:<slot>` were not provided

My natural inclination was to use the ordering found with 'snap interfaces':
$ sudo snap connect ubuntu-core:log-observe snappy-debug:log-observe
[|] Connect ubuntu-core:log-observe to snappy-debug:log-observe
error: cannot perform the following tasks:
- Connect ubuntu-core:log-observe to snappy-debug:log-observe (cannot connect plug "log-observe" from snap "ubuntu-core", no such plug)

(this error seemed a bit cryptic to me) but then I remembered the ordering was the other way:
$ sudo snap connect snappy-debug:log-observe ubuntu-core:log-observe
[/] Connect snappy-debug:log-observe to ubuntu-core:log-observe

If this is all designed and thought out and an active decision, feel free to mark as "Won't Fix", but I thought I'd at least mention it.

Revision history for this message
Gustavo Niemeyer (niemeyer) wrote :

The small inconsistency there was intentional, but I have a couple of suggestions to fix it.

The problem is this: the second column in the output of snap interfaces, the Plug one, will often have multiple entries (e.g. all plugs connected to :x11, for example). If we display it first, we end up with a very wide column first pushing the second column too far apart for the eye to be able to comfortably related the two.

So, I see two possible ways to fix this, and perhaps we can implement both of them:

1. Instead of aggregating plugs on a single line, we can break them down so that each line has a single slot and plug pair.

2. We can tweak "snap connect" so that it accepts its arguments in any order. This works fine because a snap cannot have a plug and a slot with the same name, so any pair is necessarily unambiguous.

Revision history for this message
Chad Miller (cmiller) wrote :

Ugh. Just hit this. As long as the snap-connect order matters, snap-interfaces order is wrong.

John Lenton (chipaca)
Changed in snappy:
status: New → Confirmed
importance: Undecided → Low
Michael Vogt (mvo)
affects: snappy → snapd
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.