MCPcopy Create free account
hub / github.com/apache/cloudstack / delete

Method delete

scripts/vm/hypervisor/xenserver/xcposs/NFSSR.py:194–213  ·  view source on GitHub ↗
(self, sr_uuid)

Source from the content-addressed store, hash-verified

192 self.detach(sr_uuid)
193
194 def delete(self, sr_uuid):
195 # try to remove/delete non VDI contents first
196 super(NFSSR, self).delete(sr_uuid)
197 try:
198 if self._checkmount():
199 self.detach(sr_uuid)
200
201 # Set the target path temporarily to the base dir
202 # so that we can remove the target SR directory
203 self.remotepath = self.dconf['serverpath']
204 self.mount_remotepath(sr_uuid)
205 newpath = os.path.join(self.path, sr_uuid)
206
207 if util.ioretry(lambda: util.pathexists(newpath)):
208 util.ioretry(lambda: os.rmdir(newpath))
209 self.detach(sr_uuid)
210 except util.CommandException, inst:
211 self.detach(sr_uuid)
212 if inst.code != errno.ENOENT:
213 raise xs_errors.XenError('NFSDelete')
214
215 def vdi(self, uuid, loadLocked = False):
216 if not loadLocked:

Callers

nothing calls this directly

Calls 5

_checkmountMethod · 0.95
detachMethod · 0.95
mount_remotepathMethod · 0.95
deleteMethod · 0.65
joinMethod · 0.45

Tested by

no test coverage detected