Skip to content

Commit

Permalink
orchestra/daemon: separate register_daemon from add_daemon
Browse files Browse the repository at this point in the history
The former registers without starting; the latter does both (as before).

Signed-off-by: Sage Weil <[email protected]>
(cherry picked from commit 2bcf6fe)
  • Loading branch information
liewegas authored and smithfarm committed Apr 19, 2017
1 parent 608249c commit cfbabd0
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions teuthology/orchestra/daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,25 @@ def __init__(self):
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)
Expand All @@ -169,7 +187,6 @@ def add_daemon(self, remote, type_, id_, *args, **kwargs):
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'):
"""
Expand Down

0 comments on commit cfbabd0

Please sign in to comment.