def check_bits(self, req): cmd = jsonobject.loads(req[http.REQUEST_BODY]) rsp = CheckBitsRsp() install_abs_path = translate_absolute_path_from_install_path(cmd.path) rsp.existing = lvm.lv_exists(install_abs_path) if cmd.vgUuid is not None and lvm.vg_exists(cmd.vgUuid): rsp.totalCapacity, rsp.availableCapacity = lvm.get_vg_size(cmd.vgUuid, False) return jsonobject.dumps(rsp)
def check_disks(self, req): cmd = jsonobject.loads(req[http.REQUEST_BODY]) rsp = AgentRsp() for diskUuid in cmd.sharedBlockUuids: disk = CheckDisk(diskUuid) path = disk.get_path() if cmd.rescan: disk.rescan(path.split("/")[-1]) if cmd.vgUuid is not None and lvm.vg_exists(cmd.vgUuid): rsp.totalCapacity, rsp.availableCapacity = lvm.get_vg_size( cmd.vgUuid, False) return jsonobject.dumps(rsp)
def check_disks(self, req): cmd = jsonobject.loads(req[http.REQUEST_BODY]) rsp = AgentRsp() if cmd.failIfNoPath: CheckDisk.set_fail_if_no_path() for diskUuid in cmd.sharedBlockUuids: disk = CheckDisk(diskUuid) path = disk.get_path() if cmd.rescan: disk.rescan(path.split("/")[-1]) if cmd.vgUuid is not None and lvm.vg_exists(cmd.vgUuid): rsp.totalCapacity, rsp.availableCapacity = lvm.get_vg_size(cmd.vgUuid, False) return jsonobject.dumps(rsp)