]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: check for events key before accessing it 46897/head
authorRedouane Kachach <rkachach@redhat.com>
Wed, 29 Jun 2022 15:13:48 +0000 (17:13 +0200)
committerRedouane Kachach <rkachach@redhat.com>
Wed, 29 Jun 2022 15:13:48 +0000 (17:13 +0200)
Fixes: https://tracker.ceph.com/issues/55808
Signed-off-by: Redouane Kachach <rkachach@redhat.com>
qa/tasks/cephfs/test_nfs.py

index 47b3e63a6da984c1fbfde5d8fc3280ef5cf6c8b4..1f439cd3183144206b47b07b1588365c023533e4 100644 (file)
@@ -83,11 +83,16 @@ class TestNFS(MgrTestCase):
         '''
         event_occurred = False
         # Wait few seconds for NFS daemons' status to be updated
-        with contextutil.safe_while(sleep=10, tries=12, _raise=False) as proceed:
+        with contextutil.safe_while(sleep=10, tries=18, _raise=False) as proceed:
             while not event_occurred and proceed():
                 daemons_details = json.loads(
                     self._fetch_nfs_daemons_details(enable_json=True))
                 log.info('daemons details %s', daemons_details)
+                # 'events' key may not exist in the daemon description
+                # after a mgr fail over and could take some time to appear
+                # (it's populated on first daemon event)
+                if 'events' not in daemons_details[0]:
+                    continue
                 for event in daemons_details[0]['events']:
                     log.info('daemon event %s', event)
                     if expected_event in event: