]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
qa/tasks/cephadm: fix log whitelist when there is no whitelist
authorSage Weil <sage@redhat.com>
Fri, 17 Jan 2020 22:59:43 +0000 (22:59 +0000)
committerSage Weil <sage@redhat.com>
Fri, 17 Jan 2020 22:59:43 +0000 (22:59 +0000)
Signed-off-by: Sage Weil <sage@redhat.com>
qa/tasks/cephadm.py

index 4309a8a5450db04d842f906d97a598860b6a4178..f343a0b8bf948868dacd65ec77aa17e5df74fbc2 100644 (file)
@@ -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