]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
tasks/cephfs: be tolerant of multiple MDSs
authorJohn Spray <jspray@redhat.com>
Wed, 4 Feb 2015 12:52:42 +0000 (12:52 +0000)
committerJohn Spray <jspray@redhat.com>
Tue, 14 Apr 2015 13:13:38 +0000 (14:13 +0100)
...as long as only one is active, all the ops
that default to talking to a single MDS should
be happy to talk to the active MDS, even if there
happens to be a standby lying around too.

Signed-off-by: John Spray <john.spray@redhat.com>
tasks/cephfs/filesystem.py

index 07acd1fc62f31dddcf18c5ef4fd52830348ce4f4..63f535ec8b443808afc60e8f46708e641a6d215e 100644 (file)
@@ -188,7 +188,11 @@ class Filesystem(object):
 
     def get_lone_mds_id(self):
         if len(self.mds_ids) != 1:
-            raise ValueError("Explicit MDS argument required when multiple MDSs in use")
+            active = self.get_active_names()
+            if len(active) == 1:
+                return active[0]
+            else:
+                raise ValueError("Explicit MDS argument required when multiple MDSs in use")
         else:
             return self.mds_ids[0]