def deleteImage(path): shell.call('rm -f %s' % path) logger.debug('successfully delete %s' % path) if (path.endswith('.qcow2')): imfFiles = [".imf", ".imf2"] for f in imfFiles: filePath = path.replace(".qcow2", f) shell.call('rm -f %s' % filePath) pdir = os.path.dirname(path) linux.rmdir_if_empty(pdir)
def delete(self, req): cmd = jsonobject.loads(req[http.REQUEST_BODY]) rsp = AgentResponse() shell.call('rm -f %s' % cmd.path) pdir = os.path.dirname(cmd.path) linux.rmdir_if_empty(pdir) logger.debug('successfully delete %s' % cmd.path) return jsonobject.dumps(rsp)
def deleteImage(path): linux.rm_file_checked(path) logger.debug('successfully delete %s' % path) if (path.endswith('.qcow2')): imfFiles = [".imf",".imf2"] for f in imfFiles: filePath = path.replace(".qcow2", f) linux.rm_file_force(filePath) pdir = os.path.dirname(path) linux.rmdir_if_empty(pdir)
def deleteImage(path): linux.rm_file_checked(path) logger.debug('successfully delete %s' % path) if (path.endswith('.qcow2')): imfFiles = [".imf", ".imf2"] for f in imfFiles: filePath = path.replace(".qcow2", f) linux.rm_file_force(filePath) pdir = os.path.dirname(path) linux.rmdir_if_empty(pdir)
def delete_bits(self, req): cmd = jsonobject.loads(req[http.REQUEST_BODY]) rsp = AgentRsp() shell.call('rm -f %s' % cmd.path) pdir = os.path.dirname(cmd.path) linux.rmdir_if_empty(pdir) logger.debug('successfully delete %s' % cmd.path) rsp.totalCapacity, rsp.availableCapacity = self._get_disk_capacity() return jsonobject.dumps(rsp)
def delete(self, req): cmd = jsonobject.loads(req[http.REQUEST_BODY]) rsp = DeleteResponse() if cmd.isFolder: shell.call('rm -rf %s' % cmd.installPath) else: shell.call('rm -f %s' % cmd.installPath) pdir = os.path.dirname(cmd.installPath) linux.rmdir_if_empty(pdir) logger.debug('successfully delete %s' % cmd.installPath) self._set_capacity_to_response(cmd.uuid, rsp) return jsonobject.dumps(rsp)