lxd provider: better errors when bootstrap failed #4984

Merged
merged 6 commits into from Apr 7, 2016

Conversation

Projects
None yet
3 participants
Contributor

tych0 commented Apr 4, 2016

When LXD isn't installed:

$ juju bootstrap bob lxd
ERROR invalid config: can't connect to the local LXD server: LXD socket not found; is LXD installed & running?

Please install LXD by running:
$ sudo apt-get install lxd
and then configure it with:
$ newgrp lxd
$ lxd init

When the user doesn't have permissions:

$ juju bootstrap bob lxd
ERROR invalid config: can't connect to the local LXD server: Permisson denied, are you in the lxd group?

Please configure LXD by running:
$ newgrp lxd
$ lxd init

Signed-off-by: Tycho Andersen tycho.andersen@canonical.com

(Review request: http://reviews.vapour.ws/r/4424/)

+and then configure it with:
+ $ newgrp lxd
+ $ lxd init
+`)
@jameinel

jameinel Apr 5, 2016

Owner

Shouldn't there be a test for each of the 4 cases? (EACCES, ENOENT, ECONNREFUSED, and unknown error?

Owner

jameinel commented Apr 5, 2016

The change looks very nice. Just want a couple tests to make sure we preserve the functionality.

Originally I thought we should install lxd, but I realize that requires sudo so we should probably ask the user to do it.

Contributor

tych0 commented Apr 5, 2016

On Tue, Apr 05, 2016 at 07:11:39AM -0700, John Arbash Meinel wrote:

The change looks very nice. Just want a couple tests to make sure we preserve the functionality.

Originally I thought we should install lxd, but I realize that requires sudo so we should probably ask the user to do it.

Well, and we want the user to configure their storage backend too
(i.e. hopefully use ZFS). Anyway, I'll add the test shortly.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
#4984 (comment)

Contributor

tych0 commented Apr 5, 2016

Ok, I've added the tests. We needed one small patch to actually be able to test this code path, but other than that it turned out to be pretty simple.

Tycho Andersen added some commits Apr 4, 2016

lxd provider: better errors when bootstrap failed
When LXD isn't installed:

$ juju bootstrap bob lxd
ERROR invalid config: can't connect to the local LXD server: LXD socket not found; is LXD installed & running?

Please install LXD by running:
  $ sudo apt-get install lxd
and then configure it with:
  $ newgrp lxd
  $ lxd init

When the user doesn't have permissions:

$ juju bootstrap bob lxd
ERROR invalid config: can't connect to the local LXD server: Permisson denied, are you in the lxd group?

Please configure LXD by running:
  $ newgrp lxd
  $ lxd init

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
lxd client: add tests for various Connect() error conditions
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
lxd client: allow connecting to local non-default-path unix remotes
This is mostly for testing.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
lxd provider: check if lxdbr0 is configured
...and if it's not, give a better error message.

Also add a bit about configuration of lxdbr0 to the install tips for lxd.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Contributor

tych0 commented Apr 6, 2016

Just a note that I rebased everything and added one more patch on top to warn if lxdbr0 is configured incorrectly (with a test).

Tycho Andersen added some commits Apr 6, 2016

lxd provider: remove dpkg-reconfigure hint lxd init hint is present
lxd init is now a superset of the dpkg-reconfigure bits (i.e. the bridge
configuration bits), so let's not tell users to do both.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
lxd container type: split out giant case into extra function
a fix from review

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Owner

jameinel commented Apr 7, 2016

$$merge$$

Contributor

jujubot commented Apr 7, 2016

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

@jujubot jujubot merged commit 9a9dcb0 into juju:master Apr 7, 2016

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