Include domain id in name stem

This commit is contained in:
Théophile Bastian 2022-03-08 15:27:37 +01:00
parent 9a5b6a996d
commit bdfe0e1878

View file

@ -38,7 +38,8 @@ class OverlayDirectory:
root_temp_dir.mkdir() root_temp_dir.mkdir()
self.overlay_temp_dir = tempfile.TemporaryDirectory( self.overlay_temp_dir = tempfile.TemporaryDirectory(
prefix=name + ("_" if name else ""), dir=root_temp_dir.resolve(), prefix=name + ("_" if name else ""),
dir=root_temp_dir.resolve(),
) )
self.temp_dir = Path(self.overlay_temp_dir.name) self.temp_dir = Path(self.overlay_temp_dir.name)
self.temp_dir_cleaner = None self.temp_dir_cleaner = None
@ -142,9 +143,9 @@ class Container(util.LibvirtObject):
super().__init__(conn) super().__init__(conn)
if not name: self.name = f"{settings.PREFIX}_dom{self.id:02d}"
name = str(self.id) if name:
self.name = settings.PREFIX + "_dom_" + name self.name += "_" + name
self.networks = networks self.networks = networks
self.mem = mem self.mem = mem