From f3f5c218024434109329ccd3014f83c6c77202f9 Mon Sep 17 00:00:00 2001 From: John Spray Date: Wed, 8 Apr 2015 10:41:20 +0100 Subject: [PATCH] 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) --- tasks/cephfs/filesystem.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tasks/cephfs/filesystem.py b/tasks/cephfs/filesystem.py index 86b973e3f7e41..5023c143823c4 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] -- 2.39.5