Make add run_list a separate function

Change-Id: Ib4c2b58e8966c1988c0ff59053ced836a75fd363
This commit is contained in:
Yun Mao 2013-05-22 23:31:33 -04:00
parent 12aa04b46d
commit 4b00c061e5

View File

@ -323,9 +323,12 @@ class Orchestrator(object):
hostnames = ([self._chefserver_name, self._gateway_name, hostnames = ([self._chefserver_name, self._gateway_name,
self._controller_name] + self._worker_names) self._controller_name] + self._worker_names)
for hostname in hostnames: for hostname in hostnames:
self._add_run_list(hostname, recipe)
def _add_run_list(self, hostname, item):
cmd.ssh(self.user + '@' + self._chefserver_ip, cmd.ssh(self.user + '@' + self._chefserver_ip,
"/usr/bin/knife node run_list add %s %s" % ( "/usr/bin/knife node run_list add %s %s" % (
hostname, recipe), hostname, item),
screen_output=True, screen_output=True,
agent_forwarding=True) agent_forwarding=True)