diff --git a/category/get_disk_info.py b/category/get_disk_info.py index fc56533c1a1f5408c34118aea9e0c67e0d6dd9cc..d9cc0b4ad5a231e6a86f846027d0397ebb7ad2ab 100644 --- a/category/get_disk_info.py +++ b/category/get_disk_info.py @@ -79,6 +79,12 @@ class DiskInfo: get blktrace information in output/blktrace ''' + if 1 != int(self.__bt_enable): + return True + + if not Command.cmd_exists('blktrace'): + return False + ret = True bt_devlst = self.__bt_devlst.split(',') i = 0 @@ -102,4 +108,8 @@ class DiskInfo: split = '=' if i==len(bt_devlst) else '-' ret &= Command.cmd_output(cmd_name, res, self.__default_file_name, split) + else: + Logger().error("blktrace功能异常: 配置文件中设置磁盘[{}]不存在,请修改后重试。".format(dev)) + ret &= False + return ret \ No newline at end of file