From: Vasu Kulkarni Date: Thu, 3 May 2018 20:58:00 +0000 (-0700) Subject: regsiter as well X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fheads%2Fwip-ansible-dg;p=teuthology.git regsiter as well Signed-off-by: Vasu Kulkarni --- diff --git a/teuthology/misc.py b/teuthology/misc.py index 59825bc98..fe4328e71 100644 --- a/teuthology/misc.py +++ b/teuthology/misc.py @@ -28,6 +28,7 @@ from .orchestra import run from .config import config from .contextutil import safe_while from .orchestra.opsys import DEFAULT_OS_VERSION +from teuthology.orchestra.daemon import DaemonGroup log = logging.getLogger(__name__) @@ -355,6 +356,18 @@ def roles_of_type(roles_for_host, type_): yield id_ +def register_daemons(ctx): + """ + Register daemons in ctx.deamons when cluster is + setup by ceph-ansible or ceph-deploy + """ + ctx.daemons = DaemonGroup(use_systemd=True) + for remote, roles in ctx.cluster.remotes.iteritems(): + for role in roles: + _, role, id = split_role(role) + ctx.daemons.register_daemon(remote, role, id) + + def cluster_roles_of_type(roles_for_host, type_, cluster): """ Generator of roles. diff --git a/teuthology/task/ceph_ansible.py b/teuthology/task/ceph_ansible.py index 6235e6cf4..00e2ef9cc 100644 --- a/teuthology/task/ceph_ansible.py +++ b/teuthology/task/ceph_ansible.py @@ -9,10 +9,9 @@ from cStringIO import StringIO from . import Task from tempfile import NamedTemporaryFile from ..config import config as teuth_config -from ..misc import get_scratch_devices +from ..misc import get_scratch_devices, register_daemons from teuthology import contextutil from teuthology.orchestra import run -from teuthology.orchestra.daemon import DaemonGroup from teuthology import misc log = logging.getLogger(__name__) @@ -135,7 +134,7 @@ class CephAnsible(Task): else: self.run_playbook() # setup deamongroup to use systemd - self.ctx.daemons = DaemonGroup(use_systemd=True) + register_daemons(self.ctx) def generate_hosts_file(self): hosts_dict = dict() @@ -514,4 +513,5 @@ class CephAnsible(Task): class CephAnsibleError(Exception): pass + task = CephAnsible