From: John Spray Date: Wed, 8 Apr 2015 09:41:20 +0000 (+0100) Subject: tasks/cephfs: cope with missing ctx.daemons attr X-Git-Tag: v10.2.6~165^2^2~482^2~7^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=49505067df054e19ecf43211045e987e7b870248;p=ceph.git tasks/cephfs: cope with missing ctx.daemons attr ...so that we may be used with the ceph_deploy task that doesn't set that up. Signed-off-by: John Spray (cherry picked from commit f36011051cabb8e7b06194c778e640e98d328e8a) --- diff --git a/tasks/cephfs/filesystem.py b/tasks/cephfs/filesystem.py index bc3a0d6f262..5931f374522 100644 --- a/tasks/cephfs/filesystem.py +++ b/tasks/cephfs/filesystem.py @@ -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]