]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
tasks/cephfs: cope with missing ctx.daemons attr
authorJohn Spray <jspray@redhat.com>
Wed, 8 Apr 2015 09:41:20 +0000 (10:41 +0100)
committerJohn Spray <jcspray@gmail.com>
Tue, 21 Apr 2015 13:20:44 +0000 (14:20 +0100)
...so that we may be used with the ceph_deploy task
that doesn't set that up.

Signed-off-by: John Spray <john.spray@redhat.com>
(cherry picked from commit f36011051cabb8e7b06194c778e640e98d328e8a)

tasks/cephfs/filesystem.py

index bc3a0d6f262b11adb497ba5db27761dc96140435..5931f3745225e8f41b7ea8ede88a1c84551f4ea2 100644 (file)
@@ -51,7 +51,9 @@ class Filesystem(object):
         else:
             self.admin_remote = admin_remote
         self.mon_manager = ceph_manager.CephManager(self.admin_remote, ctx=ctx, logger=log.getChild('ceph_manager'))
-        self.mds_daemons = dict([(mds_id, self._ctx.daemons.get_daemon('mds', mds_id)) for mds_id in self.mds_ids])
+        if hasattr(self._ctx, "daemons"):
+            # Presence of 'daemons' attribute implies ceph task rather than ceph_deploy task
+            self.mds_daemons = dict([(mds_id, self._ctx.daemons.get_daemon('mds', mds_id)) for mds_id in self.mds_ids])
 
         client_list = list(misc.all_roles_of_type(self._ctx.cluster, 'client'))
         self.client_id = client_list[0]