]> git.ipfire.org Git - nitsi.git/blobdiff - machine.py
We now use the logging module
[nitsi.git] / machine.py
index a67cbcb58d266864c75a3dd2a0f5599a2eef3860..867a8a01f791bbbc5bdff5b8285239fc6e041d68 100644 (file)
@@ -9,10 +9,13 @@ from serial_connection import serial_connection
 import os
 import libvirt
 
+import logging
+
+logger = logging.getLogger("nitsi.machine")
 
 class machine():
     def __init__(self, libvirt_con, vm_xml_file, snapshot_xml_file, image, root_uid, username, password):
-        self.log = log(4)
+        self.log = logger.getChild(os.path.basename(vm_xml_file))
         self.con = libvirt_con
         try:
             with open(vm_xml_file) as fobj:
@@ -38,7 +41,7 @@ class machine():
         self.password = password
 
     def define(self):
-        self.dom = self.con.con.defineXML(self.vm_xml)
+        self.dom = self.con.defineXML(self.vm_xml)
         if self.dom == None:
             self.log.error("Could not define VM")
             raise BaseException