Skip to content

Commit

Permalink
in check : 'not warning' in err_msg ,not report it (#465)
Browse files Browse the repository at this point in the history
* 'not warning' in err_msg ,not report it

* update
  • Loading branch information
wayyoungboy authored Oct 9, 2024
1 parent e9e91da commit 814aa3c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions handler/checker/result/result.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ def execute(self):
if not result:
err_msg = self.build_msg()
self.stdio.verbose("verify.execute end. and result is false return ResultFalseException err_msg:{0}".format(err_msg))
if err_msg.startswith("[not warning]"):
self.stdio.verbose("'not warning' in err_msg ,not report it .err_msg:{0}".format(err_msg))
return
raise ResultFalseException(err_msg)

def build_msg(self):
Expand Down
2 changes: 1 addition & 1 deletion handler/checker/tasks/observer/disk/disk_hole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ task:
report_type: execution
verify_type: equal
verify: 0
err_msg: 'not warning ,the DATA_SIZE is not 0 . need check sum(REQUIRED_SIZE)/sum(DATA_SIZE)'
err_msg: '[not warning] the DATA_SIZE is not 0 . need check sum(REQUIRED_SIZE)/sum(DATA_SIZE)'
- type: sql
sql: "select sum(REQUIRED_SIZE)/sum(DATA_SIZE) as da from oceanbase.CDB_OB_TABLET_REPLICAS group by tenant_id ORDER BY da DESC limit 1;"
result:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ task:
set_value: swapon_exist
report_type: execution
verify: '[ "exist" != "${swapon_exist}" ]'
err_msg: 'Do not warning. swapon is exist. We will check the swap'
err_msg: '[not warning] swapon is exist. We will check the swap'
- type: ssh
ssh: 'swapon --summary | grep -q "^" && echo "used" || echo "not used"'
result:
Expand Down
2 changes: 1 addition & 1 deletion handler/checker/tasks/observer/system/getenforce.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ task:
set_value: getenforce_exist
report_type: execution
verify: '[ "exist" != "${getenforce_exist}" ]'
err_msg: 'Do not warning. getenforce is exist. We will check SELinux by getenforce'
err_msg: '[not warning] getenforce is exist. We will check SELinux by getenforce'
- type: ssh
ssh: "getenforce"
result:
Expand Down

0 comments on commit 814aa3c

Please sign in to comment.