MCPcopy Index your code
hub / github.com/retspen/webvirtcloud / clone_volume

Method clone_volume

vrtManager/storage.py:223–239  ·  view source on GitHub ↗
(self, name, clone, vol_fmt=None, metadata=False)

Source from the content-addressed store, hash-verified

221 self._createXML(xml, metadata)
222
223 def clone_volume(self, name, clone, vol_fmt=None, metadata=False):
224 storage_type = self.get_type()
225 if storage_type == 'dir':
226 clone += '.img'
227 vol = self.get_volume(name)
228 if not vol_fmt:
229 vol_fmt = self.get_volume_type(name)
230 xml = """
231 <volume>
232 <name>%s</name>
233 <capacity>0</capacity>
234 <allocation>0</allocation>
235 <target>
236 <format type='%s'/>
237 </target>
238 </volume>""" % (clone, vol_fmt)
239 self._createXMLFrom(xml, vol, metadata)

Callers 1

storageFunction · 0.80

Calls 4

get_typeMethod · 0.95
get_volumeMethod · 0.95
get_volume_typeMethod · 0.95
_createXMLFromMethod · 0.95

Tested by

no test coverage detected