craft_providers.lxd.project module

Project helper utilities.

craft_providers.lxd.project.create_with_default_profile(*, lxc, project, profile='default', profile_project='default', remote='local')[source]

Create a project with a valid default profile.

LXD does not set a valid profile on newly created projects. This will create a project and set the profile to match the specified profile, typically the default.

Parameters
  • project (str) – Name of project to create.

  • remote (str) – Name of remote.

  • profile_name – Name of profile to copy.

  • lxc (LXC) –

  • profile (str) –

  • profile_project (str) –

Raises

LXDError – on unexpected error.

Return type

None

craft_providers.lxd.project.purge(*, lxc, project, remote='local')[source]

Purge a project including its instances and images.

The lxc command does not provide a straight-forward option to purge a project. This helper will purge anything related to a specified one.

Parameters
  • project (str) – Name of project to delete.

  • remote (str) – Name of remote.

  • lxc (LXC) –

Raises

LXDError – on unexpected error.

Return type

None