8 Star 0 Fork 5

src-anolis-os/glusterfs

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0312-Scripts-quota_fsck-script-KeyError-contri_size.patch 2.40 KB
一键复制 编辑 原始数据 按行查看 历史
张彬琛 提交于 2021-01-20 13:34 . import glusterfs-6.0-20.el8.src.rpm
From b1d8a5ee8b2e320aaaf9b2a145fbc285178d07bb Mon Sep 17 00:00:00 2001
From: hari gowtham <[email protected]>
Date: Tue, 22 Oct 2019 15:11:03 +0530
Subject: [PATCH 312/313] Scripts: quota_fsck script KeyError: 'contri_size'
back-port of: https://review.gluster.org/#/c/glusterfs/+/23586/
Problem: In a certain code flow, we weren't handling the
unavailability of the contri value in the dict. Trying to print
without the value resulted in erroring out.
Fix: Have printed the whole of dictionary as the values will be
helpful in understanding the state of the file/dir
>Fixes: bz#1764129
>Change-Id: I99c538adb712f281ca10e4e0088f404f515b9725
>Signed-off-by: hari gowtham <[email protected]>
BUG: 1719171
Change-Id: I99c538adb712f281ca10e4e0088f404f515b9725
Signed-off-by: hari gowtham <[email protected]>
Reviewed-on: https://code.engineering.redhat.com/gerrit/183720
Tested-by: RHGS Build Bot <[email protected]>
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <[email protected]>
---
extras/quota/quota_fsck.py | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/extras/quota/quota_fsck.py b/extras/quota/quota_fsck.py
index f03895d..485a37a 100755
--- a/extras/quota/quota_fsck.py
+++ b/extras/quota/quota_fsck.py
@@ -52,17 +52,17 @@ epilog_msg='''
def print_msg(log_type, path, xattr_dict = {}, stbuf = "", dir_size = None):
if log_type == QUOTA_VERBOSE:
- print('%-24s %-60s\nxattr_values: %s\n%s\n' % {"Verbose", path, xattr_dict, stbuf})
+ print('%-24s %-60s\nxattr_values: %s\n%s\n' % ("Verbose", path, xattr_dict, stbuf))
elif log_type == QUOTA_META_ABSENT:
- print('%-24s %-60s\n%s\n' % {"Quota-Meta Absent", path, xattr_dict})
+ print('%-24s %-60s\n%s\n' % ("Quota-Meta Absent", path, xattr_dict))
elif log_type == QUOTA_SIZE_MISMATCH:
print("mismatch")
if dir_size is not None:
- print('%24s %60s %12s %12s' % {"Size Mismatch", path, xattr_dict['contri_size'],
- dir_size})
+ print('%24s %60s %12s %12s' % ("Size Mismatch", path,
+ xattr_dict, dir_size))
else:
- print('%-24s %-60s %-12i %-12i' % {"Size Mismatch", path, xattr_dict['contri_size'],
- stbuf.st_size})
+ print('%-24s %-60s %-12i %-12i' % ("Size Mismatch", path, xattr_dict,
+ stbuf.st_size))
def size_differs_lot(s1, s2):
'''
--
1.8.3.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-anolis-os/glusterfs.git
[email protected]:src-anolis-os/glusterfs.git
src-anolis-os
glusterfs
glusterfs
a8

搜索帮助