Revision 8f215968 lib/bootstrap.py

b/lib/bootstrap.py
110 110
  utils.WriteFile(file_name, data=utils.GenerateSecret(), mode=0400)
111 111

  
112 112

  
113
def _InitGanetiServerSetup():
113
def _InitGanetiServerSetup(master_name):
114 114
  """Setup the necessary configuration for the initial node daemon.
115 115

  
116 116
  This creates the nodepass file containing the shared password for
......
133 133
                             " had exitcode %s and error %s" %
134 134
                             (result.cmd, result.exit_code, result.output))
135 135

  
136
  # Wait for node daemon to become responsive
137
  end_time = time.time() + 10.0
138
  while True:
139
    result = rpc.RpcRunner.call_version([master_name])[master_name]
140
    if not result.fail_msg:
141
      break
142

  
143
    if time.time() > end_time:
144
      raise errors.OpExecError("Node daemon didn't answer queries within"
145
                               " 10 seconds")
146

  
147
    time.sleep(1)
148

  
136 149

  
137 150
def InitCluster(cluster_name, mac_prefix,
138 151
                master_netdev, file_storage_dir, candidate_pool_size,
......
241 254
    hv_class.CheckParameterSyntax(hv_params)
242 255

  
243 256
  # set up the inter-node password and certificate
244
  _InitGanetiServerSetup()
257
  _InitGanetiServerSetup(hostname.name)
245 258

  
246 259
  # set up ssh config and /etc/hosts
247 260
  sshline = utils.ReadFile(constants.SSH_HOST_RSA_PUB)

Also available in: Unified diff