Revision 3583908a lib/backend.py
b/lib/backend.py | ||
---|---|---|
177 | 177 |
return (master_netdev, master_ip, master_node) |
178 | 178 |
|
179 | 179 |
|
180 |
def StartMaster(start_daemons): |
|
180 |
def StartMaster(start_daemons, no_voting):
|
|
181 | 181 |
"""Activate local node as master node. |
182 | 182 |
|
183 | 183 |
The function will always try activate the IP address of the master |
... | ... | |
187 | 187 |
@type start_daemons: boolean |
188 | 188 |
@param start_daemons: whether to also start the master |
189 | 189 |
daemons (ganeti-masterd and ganeti-rapi) |
190 |
@type no_voting: boolean |
|
191 |
@param no_voting: whether to start ganeti-masterd without a node vote |
|
192 |
(if start_daemons is True), but still non-interactively |
|
190 | 193 |
@rtype: None |
191 | 194 |
|
192 | 195 |
""" |
... | ... | |
217 | 220 |
|
218 | 221 |
# and now start the master and rapi daemons |
219 | 222 |
if start_daemons: |
220 |
for daemon in 'ganeti-masterd', 'ganeti-rapi': |
|
221 |
result = utils.RunCmd([daemon]) |
|
223 |
daemons_params = { |
|
224 |
'ganeti-masterd': [], |
|
225 |
'ganeti-rapi': [], |
|
226 |
} |
|
227 |
if no_voting: |
|
228 |
daemons_params['ganeti-masterd'].append('--no-voting') |
|
229 |
daemons_params['ganeti-masterd'].append('--yes-do-it') |
|
230 |
for daemon in daemons_params: |
|
231 |
cmd = [daemon] |
|
232 |
cmd.extend(daemons_params[daemon]) |
|
233 |
result = utils.RunCmd(cmd) |
|
222 | 234 |
if result.failed: |
223 | 235 |
msg = "Can't start daemon %s: %s" % (daemon, result.output) |
224 | 236 |
logging.error(msg) |
Also available in: Unified diff