Example #1
0
 def build_volume_xml(self, volume):
     """
     :type volume: Volume
     :rtype : String
     """
     volume_xml = XMLBuilder('volume')
     volume_xml.name(
         self._get_name(volume.environment and volume.environment.name or '',
             volume.name))
     volume_xml.capacity(str(volume.capacity))
     with volume_xml.target:
         volume_xml.format(type=volume.format)
     if volume.backing_store is not None:
         with volume_xml.backingStore:
             volume_xml.path(self.driver.volume_path(volume.backing_store))
             volume_xml.format(type=volume.backing_store.format)
     return str(volume_xml)
Example #2
0
 def build_volume_xml(self, volume):
     """
     :type volume: Volume
         :rtype : String
     """
     volume_xml = XMLBuilder('volume')
     volume_xml.name(
         self._get_name(
             volume.environment and volume.environment.name or '',
             volume.name))
     volume_xml.capacity(str(volume.capacity))
     with volume_xml.target:
         volume_xml.format(type=volume.format)
     if volume.backing_store is not None:
         with volume_xml.backingStore:
             volume_xml.path(self.driver.volume_path(volume.backing_store))
             volume_xml.format(type=volume.backing_store.format)
     return str(volume_xml)