Пример #1
0
 def do_delete_bits(self, path):
     install_abs_path = translate_absolute_path_from_install_path(path)
     if lvm.has_lv_tag(install_abs_path, IMAGE_TAG):
         logger.info('deleting lv image: ' + install_abs_path)
         lvm.delete_image(install_abs_path, IMAGE_TAG)
     else:
         logger.info('deleting lv volume: ' + install_abs_path)
         lvm.delete_lv(install_abs_path)
 def do_delete_bits(self, path):
     install_abs_path = translate_absolute_path_from_install_path(path)
     if lvm.has_lv_tag(install_abs_path, IMAGE_TAG):
         logger.info('deleting lv image: ' + install_abs_path)
         lvm.delete_image(install_abs_path, IMAGE_TAG)
     else:
         logger.info('deleting lv volume: ' + install_abs_path)
         lvm.delete_lv(install_abs_path)
Пример #3
0
 def do_delete_bits(self, path):
     install_abs_path = get_absolute_path_from_install_path(path)
     if lvm.has_lv_tag(install_abs_path, IMAGE_TAG):
         logger.info('deleting lv image: ' + install_abs_path)
         if lvm.lv_exists(install_abs_path):
             lvm.delete_image(install_abs_path, IMAGE_TAG)
     else:
         logger.info('deleting lv volume: ' + install_abs_path)
         r = drbd.DrbdResource(self.get_name_from_installPath(path))
         r.destroy()
         lvm.delete_lv(install_abs_path)
     lvm.delete_snapshots(install_abs_path)
Пример #4
0
    def delete_bits(self, req):
        cmd = jsonobject.loads(req[http.REQUEST_BODY])
        rsp = AgentRsp()
        if cmd.folder:
            raise Exception("not support this operation")

        install_abs_path = translate_absolute_path_from_install_path(cmd.path)
        if lvm.has_lv_tag(install_abs_path, IMAGE_TAG):
            logger.info('deleting lv image: ' + install_abs_path)
            lvm.delete_image(install_abs_path, IMAGE_TAG)
        else:
            logger.info('deleting lv volume: ' + install_abs_path)
            lvm.delete_lv(install_abs_path)
        rsp.totalCapacity, rsp.availableCapacity = lvm.get_vg_size(cmd.vgUuid)
        return jsonobject.dumps(rsp)