From 3bf953b3bf188c188b7b1302995328e1f0ebabef Mon Sep 17 00:00:00 2001 From: david hill Date: Tue, 19 Apr 2016 09:54:30 -0500 Subject: [PATCH] more fixes to adddbroot from postConfigure --- oam/oamcpp/liboamcpp.cpp | 15 ++++++++++----- oamapps/calpontConsole/calpontConsole.cpp | 13 +++++++++++-- oamapps/postConfigure/postConfigure.cpp | 3 +-- 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/oam/oamcpp/liboamcpp.cpp b/oam/oamcpp/liboamcpp.cpp index 58f3e1183..011982f13 100644 --- a/oam/oamcpp/liboamcpp.cpp +++ b/oam/oamcpp/liboamcpp.cpp @@ -6274,12 +6274,17 @@ namespace oam void Oam::distributeFstabUpdates(std::string entry, std::string toPM) { - ACK_FLAG ackflag = oam::ACK_YES; - // build and send msg - int returnStatus = sendMsgToProcMgr(FSTABUPDATE, toPM, FORCEFUL, ackflag, entry); + string cmd = startup::StartUp::installDir() + "/bin/infinidb status > /tmp/status.log"; + system(cmd.c_str()); + if (!checkLogStatus("/tmp/status.log", "InfiniDB is running") ) + return; - if (returnStatus != API_SUCCESS) - exceptionControl("distributeFstabUpdates", returnStatus); + ACK_FLAG ackflag = oam::ACK_YES; + // build and send msg + int returnStatus = sendMsgToProcMgr(FSTABUPDATE, toPM, FORCEFUL, ackflag, entry); + + if (returnStatus != API_SUCCESS) + exceptionControl("distributeFstabUpdates", returnStatus); } /*************************************************************************** diff --git a/oamapps/calpontConsole/calpontConsole.cpp b/oamapps/calpontConsole/calpontConsole.cpp index 19649f6b9..b95cdd335 100644 --- a/oamapps/calpontConsole/calpontConsole.cpp +++ b/oamapps/calpontConsole/calpontConsole.cpp @@ -1553,16 +1553,20 @@ int processCommand(string* arguments) string volumeName = oam::UnassignedName; string deviceNameID = "PMVolumeDeviceName" + oam.itoa(*pt); string deviceName = oam::UnassignedName; + string amazonDeviceNameID = "PMVolumeAmazonDeviceName" + oam.itoa(*pt); + string amazondeviceName = oam::UnassignedName; + try { oam.getSystemConfig( volumeNameID, volumeName); oam.getSystemConfig( deviceNameID, deviceName); + oam.getSystemConfig( amazonDeviceNameID, amazondeviceName); } catch(...) { continue; } - cout << "Amazon EC2 Volume Name/Device Name for DBRoot" << oam.itoa(*pt) << ": " << volumeName << ", " << deviceName << endl; + cout << "Amazon EC2 Volume Name/Device Name for DBRoot" << oam.itoa(*pt) << ": " << volumeName << ", " << deviceName << ", " << amazondeviceName << endl; } } catch (exception& e) @@ -1570,6 +1574,7 @@ int processCommand(string* arguments) cout << endl << "**** getSystemDbrootConfig Failed : " << e.what() << endl; } + // print un-assigned dbroots DBRootConfigList::iterator pt1 = undbrootlist.begin(); for( ; pt1 != undbrootlist.end() ; pt1++) { @@ -1577,16 +1582,20 @@ int processCommand(string* arguments) string volumeName = oam::UnassignedName; string deviceNameID = "PMVolumeDeviceName" + oam.itoa(*pt1); string deviceName = oam::UnassignedName; + string amazonDeviceNameID = "PMVolumeAmazonDeviceName" + oam.itoa(*pt1); + string amazondeviceName = oam::UnassignedName; + try { oam.getSystemConfig( volumeNameID, volumeName); oam.getSystemConfig( deviceNameID, deviceName); + oam.getSystemConfig( amazonDeviceNameID, amazondeviceName); } catch(...) { continue; } - cout << "Amazon EC2 Volume Name/Device Name for DBRoot" << oam.itoa(*pt1) << ": " << volumeName << ", " << deviceName << endl; + cout << "Amazon EC2 Volume Name/Device Name for DBRoot" << oam.itoa(*pt1) << ": " << volumeName << ", " << deviceName << ", " << amazondeviceName << endl; } } diff --git a/oamapps/postConfigure/postConfigure.cpp b/oamapps/postConfigure/postConfigure.cpp index 166a08dec..4041b5f2b 100644 --- a/oamapps/postConfigure/postConfigure.cpp +++ b/oamapps/postConfigure/postConfigure.cpp @@ -2528,12 +2528,11 @@ int main(int argc, char *argv[]) } catch(...) {} - } catch (exception& e) { cout << endl << "**** addDbroot Failed: " << e.what() << endl; - break; + exit(1); } }