summaryrefslogtreecommitdiff
path: root/buildscripts/resmokelib/testing/hooks/check_primary.py
diff options
context:
space:
mode:
authorYves Duhem <yves.duhem@mongodb.com>2018-02-27 11:29:41 -0500
committerYves Duhem <yves.duhem@mongodb.com>2018-02-27 11:29:46 -0500
commit4a69dcaf78f29cf440ada961c7e59de6b5dde111 (patch)
treeaceb8f015e234f940c94e67b5a756e1a7f8baab3 /buildscripts/resmokelib/testing/hooks/check_primary.py
parenta77297dbe34d5cd838a4da55e9d83dc70c510bba (diff)
downloadmongo-4a69dcaf78f29cf440ada961c7e59de6b5dde111.tar.gz
SERVER-33476 Rename CustomBehavior to Hook
Diffstat (limited to 'buildscripts/resmokelib/testing/hooks/check_primary.py')
-rw-r--r--buildscripts/resmokelib/testing/hooks/check_primary.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/buildscripts/resmokelib/testing/hooks/check_primary.py b/buildscripts/resmokelib/testing/hooks/check_primary.py
index 8af5fde200d..3c2d128145b 100644
--- a/buildscripts/resmokelib/testing/hooks/check_primary.py
+++ b/buildscripts/resmokelib/testing/hooks/check_primary.py
@@ -8,18 +8,19 @@ from . import interface
from ..fixtures import replicaset
from ... import errors
-import pymongo
+import pymongo.errors
-class CheckPrimary(interface.CustomBehavior):
+class CheckPrimary(interface.Hook):
def __init__(self, hook_logger, rs_fixture):
description = "Verify that the primary has not stepped down or changed"
- interface.CustomBehavior.__init__(self, hook_logger, rs_fixture, description)
+ interface.Hook.__init__(self, hook_logger, rs_fixture, description)
if not isinstance(rs_fixture, replicaset.ReplicaSetFixture):
raise TypeError("{} is not a replica set".format(rs_fixture.__class__.__name__))
self._rs_fixture = rs_fixture
+ self._primary_url = None
def _get_primary_url(self):
no_primary_err = errors.ServerFailure("No primary found")
@@ -35,7 +36,6 @@ class CheckPrimary(interface.CustomBehavior):
raise no_primary_err
-
def before_test(self, test, test_report):
self._primary_url = self._get_primary_url()