Commit 96587f58 authored by unknown's avatar unknown

Forgott to update testBackuo w.r.t to ConfigRetreiver

parent a95ad750
...@@ -69,17 +69,24 @@ NdbBackup::getFileSystemPathForNode(int _node_id){ ...@@ -69,17 +69,24 @@ NdbBackup::getFileSystemPathForNode(int _node_id){
/** /**
* Fetch configuration from management server * Fetch configuration from management server
*/ */
ConfigRetriever cr; ConfigRetriever cr(0, NODE_TYPE_API);
ndb_mgm_configuration * p;
ndb_mgm_configuration * p = cr.getConfig(host.c_str(), port, 0, NODE_TYPE_API); BaseString tmp; tmp.assfmt("%s:%d", host.c_str(), port);
if(p == 0){ NdbMgmHandle handle = ndb_mgm_create_handle();
const char * s = cr.getErrorString(); if(handle == 0 || ndb_mgm_connect(handle, tmp.c_str()) != 0 &&
if(s == 0) (p = ndb_mgm_get_configuration(handle, 0)) == 0){
s = "No error given!";
ndbout << "Could not fetch configuration" << endl; const char * s = 0;
ndbout << s << endl; if(p == 0 && handle != 0){
return NULL; s = ndb_mgm_get_latest_error_msg(handle);
if(s == 0)
s = "No error given!";
ndbout << "Could not fetch configuration" << endl;
ndbout << s << endl;
return NULL;
}
} }
/** /**
......
...@@ -46,21 +46,21 @@ NdbRestarter::NdbRestarter(const char* _addr): ...@@ -46,21 +46,21 @@ NdbRestarter::NdbRestarter(const char* _addr):
return; return;
} }
if (lcfg.items == 0){ if (lcfg.ids.size() == 0){
g_err << "NdbRestarter - No management servers configured in local config file" << endl; g_err << "NdbRestarter - No management servers configured in local config file" << endl;
return; return;
} }
for (int i = 0; i<lcfg.items; i++){ for (int i = 0; i<lcfg.ids.size(); i++){
MgmtSrvrId * m = lcfg.ids[i]; MgmtSrvrId * m = &lcfg.ids[i];
switch(m->type){ switch(m->type){
case MgmId_TCP: case MgmId_TCP:
char buf[255]; char buf[255];
snprintf(buf, 255, "%s:%d", m->data.tcp.remoteHost, m->data.tcp.port); snprintf(buf, 255, "%s:%d", m->name.c_str(), m->port);
addr.assign(buf); addr.assign(buf);
host.assign(m->data.tcp.remoteHost); host.assign(m->name.c_str());
port = m->data.tcp.port; port = m->port;
return; return;
break; break;
case MgmId_File: case MgmId_File:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment