From: Sage Weil Date: Fri, 17 Mar 2017 19:46:22 +0000 (-0400) Subject: orchestra/daemon: separate register_daemon from add_daemon X-Git-Tag: 1.1.0~443^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F1047%2Fhead;p=teuthology.git orchestra/daemon: separate register_daemon from add_daemon The former registers without starting; the latter does both (as before). Signed-off-by: Sage Weil --- diff --git a/teuthology/orchestra/daemon.py b/teuthology/orchestra/daemon.py index 3c40aaa5d..acbdf70e3 100644 --- a/teuthology/orchestra/daemon.py +++ b/teuthology/orchestra/daemon.py @@ -150,7 +150,25 @@ class DaemonGroup(object): def add_daemon(self, remote, type_, id_, *args, **kwargs): """ Add a daemon. If there already is a daemon for this id_ and role, stop - that daemon and. Restart the damon once the new value is set. + that daemon. (Re)start the daemon once the new value is set. + + :param remote: Remote site + :param type_: type of daemon (osd, mds, mon, rgw, for example) + :param id_: Id (index into role dictionary) + :param args: Daemonstate positional parameters + :param kwargs: Daemonstate keyword parameters + """ + # for backwards compatibility with older ceph-qa-suite branches, + # we can only get optional args from unused kwargs entries + self.register_daemon(remote, type_, id_, *args, **kwargs) + cluster = kwargs.pop('cluster', 'ceph') + role = cluster + '.' + type_ + self.daemons[role][id_].restart() + + def register_daemon(self, remote, type_, id_, *args, **kwargs): + """ + Add a daemon. If there already is a daemon for this id_ and role, stop + that daemon. :param remote: Remote site :param type_: type of daemon (osd, mds, mon, rgw, for example) @@ -169,7 +187,6 @@ class DaemonGroup(object): self.daemons[role][id_] = None self.daemons[role][id_] = DaemonState(remote, role, id_, *args, **kwargs) - self.daemons[role][id_].restart() def get_daemon(self, type_, id_, cluster='ceph'): """