interfaces/builtin: make all interfaces private #3295

Merged
merged 3 commits into from May 12, 2017

Conversation

Projects
None yet
2 participants
Contributor

zyga commented May 10, 2017

The rest of snapd doesn't need to access interface types, all that is
requires is the builtin.Interfaces function, that returns the list of
all known interfaces.

This patch makes interfaces private, adds a helper for testing, that
returns interface by name. Some tests were changed to use s.iface
rather than trying to construct the interface object needlessly. Some
tests were changed to use spec.AddConnectedPlug rather than
iface.MountConnectedPlug so that the interface test code does not need
to know the real interface type.

Signed-off-by: Zygmunt Krynicki zygmunt.krynicki@canonical.com

interfaces/builtin: make all interfaces private
The rest of snapd doesn't need to access interface types, all that is
requires is the builtin.Interfaces function, that returns the list of
all known interfaces.

This patch makes interfaces private, adds a helper for testing, that
returns interface by name. Some tests were changed to use `s.iface`
rather than trying to construct the interface object needlessly. Some
tests were changed to use `spec.AddConnectedPlug` rather than
`iface.MountConnectedPlug` so that the interface test code does not need
to know the real interface type.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>

Very nice. Thank you!

Also: holy cow. My head hurts now.

zyga added some commits May 11, 2017

@zyga zyga merged commit ac7c381 into snapcore:master May 12, 2017

6 of 7 checks passed

xenial-amd64 autopkgtest finished (failure)
Details
artful-amd64 autopkgtest finished (success)
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
xenial-i386 autopkgtest finished (success)
Details
xenial-ppc64el autopkgtest finished (success)
Details
yakkety-amd64 autopkgtest finished (success)
Details
zesty-amd64 autopkgtest finished (success)
Details

@zyga zyga deleted the zyga:tweak/make-interfaces-private branch May 12, 2017

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