def get_public_key(self): # Initialize LibVirtController to create keypair if needed ctrlr = libvirtcontroller.LibVirtController(self.state_dir, None, None, 'system') with open(ctrlr.public_key_file, 'r') as fd: public_key = fd.read().strip() fd.close() return public_key
def get_libvirt_controller(self): """ Get a libvirtcontroller instance """ hypervisor = self.db.config['hypervisor'] return libvirtcontroller.LibVirtController(self.state_dir, hypervisor['username'], hypervisor['host'], hypervisor['mode'])