Beispiel #1
0
 def delete_bits(self, req):
     cmd = jsonobject.loads(req[http.REQUEST_BODY])
     rsp = AgentRsp()
     if cmd.folder:
         linux.rm_dir_checked(cmd.path)
     else:
         kvmagent.deleteImage(cmd.path)
     rsp.totalCapacity, rsp.availableCapacity = self._get_disk_capacity(cmd.mountPoint)
     return jsonobject.dumps(rsp)
 def delete_bits(self, req):
     cmd = jsonobject.loads(req[http.REQUEST_BODY])
     rsp = AgentRsp()
     if cmd.folder:
         linux.rm_dir_checked(cmd.path)
     else:
         kvmagent.deleteImage(cmd.path)
     rsp.totalCapacity, rsp.availableCapacity = self._get_disk_capacity(cmd.mountPoint)
     return jsonobject.dumps(rsp)
Beispiel #3
0
    def deletedir(self, req):
        cmd = jsonobject.loads(req[http.REQUEST_BODY])
        rsp = AgentResponse()

        linux.rm_dir_checked(cmd.path)
        logger.debug('successfully delete %s' % cmd.path)

        rsp.totalCapacity, rsp.availableCapacity = self._get_disk_capacity(cmd.storagePath)
        return jsonobject.dumps(rsp)
Beispiel #4
0
    def deletedir(self, req):
        cmd = jsonobject.loads(req[http.REQUEST_BODY])
        rsp = AgentResponse()

        linux.rm_dir_checked(cmd.path)
        logger.debug('successfully delete %s' % cmd.path)

        rsp.totalCapacity, rsp.availableCapacity = self._get_disk_capacity(
            cmd.storagePath)
        return jsonobject.dumps(rsp)
Beispiel #5
0
    def delete(self, req):
        cmd = jsonobject.loads(req[http.REQUEST_BODY])
        rsp = DeleteResponse()

        if cmd.folder:
            linux.rm_dir_checked(cmd.installPath)
        else:
            kvmagent.deleteImage(cmd.installPath)
        logger.debug('successfully delete %s' % cmd.installPath)
        self._set_capacity_to_response(cmd.uuid, rsp)
        return jsonobject.dumps(rsp)
    def delete(self, req):
        cmd = jsonobject.loads(req[http.REQUEST_BODY])
        rsp = DeleteResponse()

        if cmd.folder:
            linux.rm_dir_checked(cmd.installPath)
        else:
            kvmagent.deleteImage(cmd.installPath)
        logger.debug('successfully delete %s' % cmd.installPath)
        self._set_capacity_to_response(cmd.uuid, rsp)
        return jsonobject.dumps(rsp)
 def delNasBits(self, folder, path):
     if folder:
         linux.rm_dir_checked(path)
     else:
         kvmagent.deleteImage(path)
 def delNasBits(self, folder, path):
     if folder:
         linux.rm_dir_checked(path)
     else:
         kvmagent.deleteImage(path)