]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/nfs: Add __eq__ method to Export
authorSebastian Wagner <sewagner@redhat.com>
Wed, 2 Jun 2021 10:42:54 +0000 (12:42 +0200)
committerSage Weil <sage@newdream.net>
Thu, 17 Jun 2021 20:18:06 +0000 (16:18 -0400)
Signed-off-by: Sebastian Wagner <sewagner@redhat.com>
src/pybind/mgr/nfs/export_utils.py
src/pybind/mgr/nfs/tests/test_nfs.py
src/pybind/mgr/tests/__init__.py
src/pybind/mgr/tox.ini

index 4efe1dc8fac18cd2969c4e1354567f63d324f654..b5aceb24fe26b02bd3a799f18171ea3dd33469ea 100644 (file)
@@ -494,3 +494,8 @@ class Export:
             pass
         else:
             raise NFSInvalidOperation('FSAL {self.fsal.name} not supported')
+
+    def __eq__(self, other):
+        if not isinstance(other, Export):
+            return False
+        return self.to_dict() == other.to_dict()
index 13386c4a2283680b7a88690b0f8ec0a24e616cc9..f7a4ced10340542938f7a83f857a4a4e6660d99c 100644 (file)
@@ -198,9 +198,8 @@ EXPORT
                                                    pool=cluster_info['pool'],
                                                    namespace=cluster_info['namespace']))
         ] if enable else []
-        # pylint: disable=protected-access
-        #ganesha.Ganesha._get_orch_nfs_services = Mock(return_value=orch_nfs_services)
 
+        """
         # mock nfs daemons
         def _get_nfs_instances(service_name=None):
             if not enable:
@@ -220,6 +219,8 @@ EXPORT
             for _, daemons in instances.items():
                 result.extend(daemons)
             return result
+        """
+
         with mock.patch('nfs.module.Module.describe_service') as describe_service, \
              mock.patch('nfs.module.Module.rados') as rados:
 
@@ -233,9 +234,6 @@ EXPORT
 
             yield
 
-        #ganesha.ExportMgrOrchestrator._get_orch_nfs_instances = Mock(
-        #    side_effect=_get_nfs_instances)
-
     def test_parse_daemon_raw_config(self):
         expected_daemon_config = [
             {
index bf96525193d2156645bfff41ae292318aadb3e97..7f15828cd6c793a5fb96f1d1f7b8c904155fb0e3 100644 (file)
@@ -175,11 +175,11 @@ if 'UNITTEST' in os.environ:
                 self._store = {}
 
 
-            if self.__class__.__name__ not in M_classes:
+            if self.__class__ not in M_classes:
                 # call those only once.
                 self._register_commands('')
                 self._register_options('')
-                M_classes.add(self.__class__.__name__)
+                M_classes.add(self.__class__)
 
             super(M, self).__init__()
             self._ceph_get_version = mock.Mock()
index 3181b6e97cb493fbade0e26ef4c50df76285dfe9..c54a657dd39e7c4fe7f1d5de4d1e7752753abfe4 100644 (file)
@@ -43,6 +43,7 @@ commands =
         tests/ \
         cephadm/ \
         mds_autoscaler/ \
+        nfs/ \
         orchestrator/ \
         insights/ \
         pg_autoscaler/ \