# Path: vespa/log_pipe.py
# def debug1(str):
#     print repr(str)
#     pass
# 
# Path: vespa/agent.py
# class Agent(Node):
#     def __init__(self, name, host, port, master, run=True):
#         super(Agent, self,).__init__(name, host, port, master, run)


import socket
        import libvirt
        import sys
        import os
        import time
        import xml.dom.minidom
        import libvirt
        import sys
        import os
        import time
        import xml.dom.minidom
        import libvirt
        import sys
        import os
        import time
        import xml.dom.minidom
        import libvirt
        import sys
        import os
        import time
        import xml.dom.minidom
        import libvirt
        import sys
        import os
        import time
        import xml.dom.minidom
        import libvirt
        import sys
        import os
        import time
        import xml.dom.minidom
        import libvirt
        import sys
        import os
        import time
        import xml.dom.minidom
        import libvirt
        import sys
        import os
        import time
        import xml.dom.minidom
from .log_pipe import debug1
from .agent import Agent
                                   self.libvirt_port))
        wokeup = False
        debug1(
            self.name + ">Waiting for vm %s to wake up on %s" %
            (vm, self.libvirt_host))
        vm_name, vm_host, vm_port = eval(vm)
        while not wokeup:
            try:
                dom = self._get_dom_name(vm_name, conn_local)
                wokeup = True
            except:
                debug1("Miss")
                continue
        print "sending '%s'" % args
        dom.sendKey(*eval(args))
        return ["Sent keys to the vm %s" % vm_name]

    def restart(self, vm):
        conn_local = libvirt.open("qemu+ssh://%s@%s:%s/system" %
                                  (self.libvirt_user,
                                   self.libvirt_host,
                                   self.libvirt_port))
        vm_name, vm_host, vm_port = eval(vm)
        dom = self._get_dom_name(vm_name, conn_local)
        dom.create()
        return ["VM %s restarted" % vm_name]

    def restart_hard(self, vm):
        conn_local = libvirt.open("qemu+ssh://%s@%s:%s/system" %
                                  (self.libvirt_user,

# Path: vespa/log_pipe.py
# def debug1(str):
#     print repr(str)
#     pass
# 
# Path: vespa/agent.py
# class Agent(Node):
#     def __init__(self, name, host, port, master, run=True):
#         super(Agent, self,).__init__(name, host, port, master, run)


# Path: vespa/agent_libvirt.py
import socket
        import libvirt
        import sys
        import os
        import time
        import xml.dom.minidom
        import libvirt
        import sys
        import os
        import time
        import xml.dom.minidom
        import libvirt
        import sys
        import os
        import time
        import xml.dom.minidom
        import libvirt
        import sys
        import os
        import time
        import xml.dom.minidom
        import libvirt
        import sys
        import os
        import time
        import xml.dom.minidom
        import libvirt
        import sys
        import os
        import time
        import xml.dom.minidom
        import libvirt
        import sys
        import os
        import time
        import xml.dom.minidom
        import libvirt
        import sys
        import os
        import time
        import xml.dom.minidom
from .log_pipe import debug1
from .agent import Agent

                                   self.libvirt_port))
        wokeup = False
        debug1(
            self.name + ">Waiting for vm %s to wake up on %s" %
            (vm, self.libvirt_host))
        vm_name, vm_host, vm_port = eval(vm)
        while not wokeup:
            try:
                dom = self._get_dom_name(vm_name, conn_local)
                wokeup = True
            except:
                debug1("Miss")
                continue
        print "sending '%s'" % args
        dom.sendKey(*eval(args))
        return ["Sent keys to the vm %s" % vm_name]

    def restart(self, vm):
        conn_local = libvirt.open("qemu+ssh://%s@%s:%s/system" %
                                  (self.libvirt_user,
                                   self.libvirt_host,
                                   self.libvirt_port))
        vm_name, vm_host, vm_port = eval(vm)
        dom = self._get_dom_name(vm_name, conn_local)
        dom.create()
        return ["VM %s restarted" % vm_name]

    def restart_hard(self, vm):
        conn_local = libvirt.open("qemu+ssh://%s@%s:%s/system" %
                                  (self.libvirt_user,

                                   self.libvirt_host,