Skip to content
Snippets Groups Projects
Verified Commit f3f0e88f authored by Karel Koci's avatar Karel Koci :metal:
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
bootstrapping.
parent 93573aef
No related branches found
No related tags found
1 merge request!12Feature/mterm logs
......@@ -133,7 +133,7 @@ class Image:
self.lxd_image = self._lxd.local.images.get_by_alias(self.alias())
return
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.name}-{self.hash()}"
logger.warning("Bootstrapping image '%s': %s", self.alias(), container_name)
try:
container = self._lxd.local.containers.create({
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment