lueschem / edi

Embedded development infrastructure.
https://www.get-edi.io
GNU Lesser General Public License v3.0
38 stars 12 forks source link

Adjust lxc start/stop commands so that they do not fail in case the container is already started/stopped #77

Closed lueschem closed 1 year ago

lueschem commented 1 year ago

Issue Type

Desired Behaviour

The image build command and the --recursive-clean stuff should not fail if the container is already started respectively stopped.

Actual Behaviour (Bug report only)

The image build command fails if a previous command got stopped within the container configuration step. Furthermore a stop of the container might fail if it is already stopped.

Example: 20:32:20 INFO:root:Running command: ['sudo', '-u', 'jenkins', '/snap/bin/lxc', 'delete', 'edi-tmp-f18975e27704c322d979'] 20:32:20 Error: The instance is currently running, stop it first or pass --force 20:32:20 Error: Command '['sudo', '-u', 'jenkins', '/snap/bin/lxc', 'delete', 'edi-tmp-f18975e27704c322d979']' returned non-zero exit status 1. 20:32:20 For more information increase the log level.

lueschem commented 1 year ago

The implementation is actually correct - but there is a bug in lxc: https://github.com/lxc/lxd/issues/10396