Revision 2503680f lib/backend.py

b/lib/backend.py
147 147
  return (master_netdev, master_ip, master_node)
148 148

  
149 149

  
150
def StartMaster(start_daemons):
150
def StartMaster(start_daemons, no_voting):
151 151
  """Activate local node as master node.
152 152

  
153 153
  The function will always try activate the IP address of the master
......
157 157
  @type start_daemons: boolean
158 158
  @param start_daemons: whther to also start the master
159 159
      daemons (ganeti-masterd and ganeti-rapi)
160
  @type no_voting: boolean
161
  @param no_voting: whether to start ganeti-masterd without a node vote
162
      (if start_daemons is True), but still non-interactively
160 163
  @rtype: None
161 164

  
162 165
  """
......
186 189

  
187 190
  # and now start the master and rapi daemons
188 191
  if start_daemons:
189
    for daemon in 'ganeti-masterd', 'ganeti-rapi':
190
      result = utils.RunCmd([daemon])
192
    daemons_params = {
193
        'ganeti-masterd': [],
194
        'ganeti-rapi': [],
195
        }
196
    if no_voting:
197
      daemons_params['ganeti-masterd'].append('--no-voting')
198
      daemons_params['ganeti-masterd'].append('--yes-do-it')
199
    for daemon in daemons_params:
200
      cmd = [daemon]
201
      cmd.extend(daemons_params[daemon])
202
      result = utils.RunCmd(cmd)
191 203
      if result.failed:
192 204
        logging.error("Can't start daemon %s: %s", daemon, result.output)
193 205
        ok = False

Also available in: Unified diff