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

Method detach

scripts/vm/hypervisor/xenserver/xcposs/NFSSR.py:142–157  ·  view source on GitHub ↗

Detach the SR: Unmounts and removes the mountpoint

(self, sr_uuid)

Source from the content-addressed store, hash-verified

140
141
142 def detach(self, sr_uuid):
143 """Detach the SR: Unmounts and removes the mountpoint"""
144 if not self._checkmount():
145 return
146 util.SMlog("Aborting GC/coalesce")
147 cleanup.abort(self.uuid)
148
149 # Change directory to avoid unmount conflicts
150 os.chdir(SR.MOUNT_BASE)
151
152 try:
153 nfs.unmount(self.path, True)
154 except nfs.NfsException, exc:
155 raise xs_errors.XenError('NFSUnMount', opterr=exc.errstr)
156
157 return super(NFSSR, self).detach(sr_uuid)
158
159
160 def create(self, sr_uuid, size):

Callers 2

createMethod · 0.95
deleteMethod · 0.95

Calls 2

_checkmountMethod · 0.95
detachMethod · 0.65

Tested by

no test coverage detected