From: Sage Weil Date: Fri, 17 Jan 2020 22:59:43 +0000 (+0000) Subject: qa/tasks/cephadm: fix log whitelist when there is no whitelist X-Git-Tag: v15.1.0~188^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=26819859834ba45f74adaedef413762e4ef281cf;p=ceph.git qa/tasks/cephadm: fix log whitelist when there is no whitelist Signed-off-by: Sage Weil --- diff --git a/qa/tasks/cephadm.py b/qa/tasks/cephadm.py index 4309a8a5450d..f343a0b8bf94 100644 --- a/qa/tasks/cephadm.py +++ b/qa/tasks/cephadm.py @@ -159,8 +159,9 @@ def ceph_log(ctx, config): '/var/log/ceph/{fsid}/ceph.log'.format( fsid=fsid), ] - for exclude in excludes: - args.extend([run.Raw('|'), 'egrep', '-v', exclude]) + if excludes: + for exclude in excludes: + args.extend([run.Raw('|'), 'egrep', '-v', exclude]) args.extend([ run.Raw('|'), 'head', '-n', '1', ]) @@ -174,7 +175,7 @@ def ceph_log(ctx, config): return None if first_in_ceph_log('\[ERR\]|\[WRN\]|\[SEC\]', - config['log-whitelist']) is not None: + config.get('log-whitelist')) is not None: log.warning('Found errors (ERR|WRN|SEC) in cluster log') ctx.summary['success'] = False # use the most severe problem as the failure reason