makebuildserver: make config['domain'] local var where its needed

This commit is contained in:
Hans-Christoph Steiner 2017-05-23 11:59:53 +02:00
parent c8234919df
commit a01e302cde

View file

@ -80,7 +80,6 @@ if os.path.isfile('/usr/bin/systemd-detect-virt'):
if virt == 'qemu' or virt == 'kvm' or virt == 'bochs': if virt == 'qemu' or virt == 'kvm' or virt == 'bochs':
logger.info('Running in a VM guest, defaulting to QEMU/KVM via libvirt') logger.info('Running in a VM guest, defaulting to QEMU/KVM via libvirt')
config['vm_provider'] = 'libvirt' config['vm_provider'] = 'libvirt'
config['domain'] = 'buildserver_default'
elif virt != 'none': elif virt != 'none':
logger.info('Running in an unsupported VM guest (%s)!', virt) logger.info('Running in an unsupported VM guest (%s)!', virt)
logger.debug('detected virt: %s', virt) logger.debug('detected virt: %s', virt)
@ -402,8 +401,9 @@ def debug_log_vagrant_vm(vm_dir, config):
if config['vm_provider'] == 'libvirt': if config['vm_provider'] == 'libvirt':
logger.debug('> virsh -c qmeu:///system list --all') logger.debug('> virsh -c qmeu:///system list --all')
subprocess.call(['virsh', '-c', 'qemu:///system', 'list', '--all']) subprocess.call(['virsh', '-c', 'qemu:///system', 'list', '--all'])
logger.debug('> virsh -c qemu:///system snapshot-list %s', config['domain']) domain = 'buildserver_default'
subprocess.call(['virsh', '-c', 'qemu:///system', 'snapshot-list', config['domain']]) logger.debug('> virsh -c qemu:///system snapshot-list %s', domain)
subprocess.call(['virsh', '-c', 'qemu:///system', 'snapshot-list', domain])
def main(): def main():