qubes.vm.__init__ Remove debug xml file creation

This commit is contained in:
Bahtiar `kalkin-` Gadimov 2016-06-16 14:44:56 +02:00
parent 94d9fd040f
commit ec9550c7cc

View File

@ -261,41 +261,20 @@ class BaseVM(qubes.PropertyHolder):
return '<{} object at {:#x} {}>'.format(
self.__class__.__name__, id(self), ' '.join(proprepr))
#
# xml serialising methods
#
def create_config_file(self, file_path=None, prepare_dvm=False):
def create_config_file(self, prepare_dvm=False):
'''Create libvirt's XML domain config file
:param str file_path: Path to file to create \
(default: :py:attr:`qubes.vm.qubesvm.QubesVM.conf_file`)
:param bool prepare_dvm: If we are in the process of preparing \
DisposableVM
'''
if file_path is None:
file_path = self.conf_file
domain_config = self.app.env.get_template('libvirt/xen.xml').render(
vm=self, prepare_dvm=prepare_dvm)
# FIXME: This is only for debugging purposes
old_umask = os.umask(002)
try:
conf_appvm = open(file_path, "w")
conf_appvm.write(domain_config)
conf_appvm.close()
except: # pylint: disable=bare-except
# Ignore errors
pass
finally:
os.umask(old_umask)
return domain_config
#
# firewall
# TODO rewrite it, have <firewall/> node under <domain/>