Move volume xml config from QubesVM to Volume
This commit is contained in:
parent
2e28849c90
commit
d7ff4b9057
@ -71,6 +71,9 @@ class Volume(object):
|
|||||||
self.size = size
|
self.size = size
|
||||||
self.volume_type = volume_type
|
self.volume_type = volume_type
|
||||||
|
|
||||||
|
def __xml__(self):
|
||||||
|
return lxml.etree.Element('volume', **self.config)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def config(self):
|
def config(self):
|
||||||
''' return config data for serialization to qubes.xml '''
|
''' return config data for serialization to qubes.xml '''
|
||||||
|
@ -493,8 +493,7 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM):
|
|||||||
if hasattr(self, 'volumes'):
|
if hasattr(self, 'volumes'):
|
||||||
volume_config_node = lxml.etree.Element('volume-config')
|
volume_config_node = lxml.etree.Element('volume-config')
|
||||||
for volume in self.volumes.values():
|
for volume in self.volumes.values():
|
||||||
volume_node = lxml.etree.Element('volume', **volume.config)
|
volume_config_node.append(volume.__xml__())
|
||||||
volume_config_node.append(volume_node)
|
|
||||||
|
|
||||||
element.append(volume_config_node)
|
element.append(volume_config_node)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user