craft_providers.lxd.installer module

LXD Provider.

craft_providers.lxd.installer.ensure_lxd_is_ready(*, remote='local', lxc=<craft_providers.lxd.lxc.LXC object>, lxd=<craft_providers.lxd.lxd.LXD object>)[source]

Ensure LXD is ready for use.

Raises

LXDError – on error.

Parameters
  • remote (str) –

  • lxc (LXC) –

  • lxd (LXD) –

Return type

None

craft_providers.lxd.installer.install(sudo=True)[source]

Install LXD.

Install application, using sudo if specified.

Return type

str

Returns

LXD version.

Raises
Parameters

sudo (bool) –

craft_providers.lxd.installer.is_initialized(*, remote, lxc)[source]

Verify that LXD has been initialized and configuration looks valid.

If LXD has been installed but the user has not initialized it (lxd init), the default profile won’t have devices configured. Trying to launch an instance or create a project using this profile will result in failures.

Return type

bool

Returns

True if initialized, else False.

Parameters
  • remote (str) –

  • lxc (LXC) –

craft_providers.lxd.installer.is_installed()[source]

Check if LXD is installed (and found on PATH).

Return type

bool

Returns

True if lxd is installed.

craft_providers.lxd.installer.is_user_permitted()[source]

Check if user has permissions to connect to LXD.

Return type

bool

Returns

True if user has correct permissions.