Verified Commit f3f0e88f authored by Karel Koci's avatar Karel Koci 🤘
Browse files

nsfarm/lxd: improve warning about image bootstrap

The message was being printed almost right on prepare method enter. The
problem is that it was called before parent image prepare method was
called. In effect this generated messages in reverse order. It also made
it pretty much impossible to identify which container exactly failed to
prepare as warnings for all images were printed even before any of them
started actually preparing. This moves it after parent prepare method
call and thus makes it so prepare messages are printed in order and
right before actual work is being performed.

This also gives us the option to include full container name we use for
parent 93573aef
......@@ -133,7 +133,7 @@ class Image:
self.lxd_image = self._lxd.local.images.get_by_alias(self.alias())
logger.warning("Bootstrapping image: %s", self.alias())
logger.debug("Want to bootstrap image: %s", self.alias())
image_source = {
'type': 'image',
......@@ -149,6 +149,7 @@ class Image:
image_source["alias"] = self._parent.fingerprint
container_name = f"nsfarm-bootstrap-{}-{self.hash()}"
logger.warning("Bootstrapping image '%s': %s", self.alias(), container_name)
container = self._lxd.local.containers.create({
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment