interfaces,overlord/ifacestate: fix abbreviated for of disconnect operations #1034

Closed
wants to merge 4 commits into
from

Conversation

Projects
None yet
3 participants
Contributor

zyga commented Apr 18, 2016

This branch allows user to use disconnect as advertised by snap disconnect --help.

In general, disconnect can affect more than one pair of snaps and more than one connection. Using abbreviated forms one can disconnect all plugs from a specific slot or even all plugs from all slots of a specific snap.

zyga added some commits Apr 18, 2016

interfaces: add {Plug,Slot}.Ref
This patch adds two helpers so that it is easy to create a PlugRef from
Plug and a SlotRef from Slot.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
interfaces: add ConnRef
This patch adds a structure representing a single connection.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
interfaces: return list of affected connections and snaps from Discon…
…nect

Disconnect supports abbreviated forms where one can disconnect,
for example, all the connections affecting a given snap.

Since interface manager needs to setup security of all the affected
snaps and to forget the persistent state of all the affected connections
this information is now provided directly by the Disconnect
operation.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
overlord/ifacestate: add support for abbreviated disconnect operations
This patch adds support for abbreviated disconnect operations that match
the suggestions printed by "$ snap disconnect --help". This also fixes a
bug where snapd would crash if any of those abbreviated forms were to be
used.

Fixes: https://bugs.launchpad.net/snappy/+bug/1571497
Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
Contributor

niemeyer commented Apr 18, 2016

Please don't merge this yet. There was some discussion in the last sprint which I don't think is reflected there.

Contributor

zyga commented Apr 18, 2016

@niemeyer ack, I don't mind working on this after my rest-break

Contributor

zyga commented Apr 18, 2016

retest this please

@mvo5 mvo5 closed this Apr 26, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment