summaryrefslogtreecommitdiff
path: root/ndb/src/mgmsrv/MgmtSrvrConfig.cpp
diff options
context:
space:
mode:
authorunknown <joreland@mysql.com>2004-05-26 10:56:32 +0200
committerunknown <joreland@mysql.com>2004-05-26 10:56:32 +0200
commit1a9eb476f185d94ec13ed4f13dbfbdb14f9217c1 (patch)
tree32b839686028c5bc61304dbd566705a3bc085f6d /ndb/src/mgmsrv/MgmtSrvrConfig.cpp
parent3cfddc421d53e28f398a2db98002cab2be15fc9e (diff)
downloadmariadb-git-1a9eb476f185d94ec13ed4f13dbfbdb14f9217c1.tar.gz
WL1371 - Cleanup configuration handling
WL1356 - Discless db node WL1357 - sp 1-2
Diffstat (limited to 'ndb/src/mgmsrv/MgmtSrvrConfig.cpp')
-rw-r--r--ndb/src/mgmsrv/MgmtSrvrConfig.cpp27
1 files changed, 13 insertions, 14 deletions
diff --git a/ndb/src/mgmsrv/MgmtSrvrConfig.cpp b/ndb/src/mgmsrv/MgmtSrvrConfig.cpp
index f4e53409b30..10316bd2851 100644
--- a/ndb/src/mgmsrv/MgmtSrvrConfig.cpp
+++ b/ndb/src/mgmsrv/MgmtSrvrConfig.cpp
@@ -275,31 +275,30 @@ MgmtSrvr::readConfig() {
Config *conf = NULL;
if(m_configFilename.length() != 0) {
/* Use config file */
- InitConfigFileParser parser(m_configFilename.c_str());
-
- if(!parser.readConfigFile()) {
+ InitConfigFileParser parser;
+ conf = parser.parseConfig(m_configFilename.c_str());
+
+ if(conf == NULL) {
/* Try to get configuration from other MGM server */
- ConfigRetriever cr;
- cr.setLocalConfigFileName(m_localNdbConfigFilename.c_str());
- conf = new Config(*cr.getConfig("MGM", NDB_VERSION));
- } else {
- conf = new Config(*parser.getConfig());
+ return fetchConfig();
}
-
- if(conf == NULL)
- return NULL;
}
return conf;
}
Config *
MgmtSrvr::fetchConfig() {
- Config *conf = NULL;
ConfigRetriever cr;
cr.setLocalConfigFileName(m_localNdbConfigFilename.c_str());
- conf = new Config(*cr.getConfig("MGM", NDB_VERSION));
+ struct ndb_mgm_configuration * tmp = cr.getConfig(NDB_VERSION,
+ NODE_TYPE_MGM);
+ if(tmp != 0){
+ Config * conf = new Config();
+ conf->m_configValues = tmp;
+ return conf;
+ }
- return conf;
+ return 0;
}
bool