]> git.apps.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:15:16 +0000 (14:15 +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 86b973e3f7e410a65be5ca6e3d90564b1407b52e..5023c143823c412349b6224fa27f9cab623ffb78 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]