]> 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)
committerGreg Farnum <gfarnum@redhat.com>
Mon, 20 Apr 2015 00:46:18 +0000 (17:46 -0700)
...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>
tasks/cephfs/filesystem.py

index a30e502c27bc7b0d8e63c657a4f9691c3bcff7b2..6367203c04018aee714dfeb3800a8aed8913934f 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]