Browse Source

enough: if the libvirt host exists, update hosts.yml

keep-around/b20fd39444566ac137ca647354cb009d4b33699d
Loïc Dachary 7 months ago
committed by some
parent
commit
35d8a2fbe7
Signed by: dachary GPG Key ID: 992D23B392F9E4F2
  1. 8
      enough/common/libvirt.py

8
enough/common/libvirt.py

@ -70,7 +70,13 @@ class Libvirt(object):
def _create_or_update(self, definition):
name = definition['name']
if self.get(name) is not None:
return None
info = {
'ipv4': self.get_ipv4(name),
'port': definition['port'],
}
Hosts(self.config_dir).create_or_update(
definition['name'], info['ipv4'], info['port'])
return info
log.info(f"{name}: building image")
self.image_builder()
sh.cp('--sparse=always', self.image_name(), self.host_image_name(name))

Loading…
Cancel
Save