You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +03:00
MCOL-1607. Tentative change to include addModule.
This might or might not let addModule store host names instead of IP addresses.
This commit is contained in:
@ -309,8 +309,9 @@
|
|||||||
<Desc4>MariaDB Columnstore Packages and setup the module to make it ready to be restored</Desc4>
|
<Desc4>MariaDB Columnstore Packages and setup the module to make it ready to be restored</Desc4>
|
||||||
<Arg1>Required: Module-type or Module-name being added</Arg1>
|
<Arg1>Required: Module-type or Module-name being added</Arg1>
|
||||||
<Arg2>Required: Number-of-Modules being added when Module-type is specified</Arg2>
|
<Arg2>Required: Number-of-Modules being added when Module-type is specified</Arg2>
|
||||||
<Arg3>Optional: Server-Hostnames/Amazon-Instance-Names seperated by commas</Arg3>
|
<Arg3>Optional: Store given hostnames in the configuration instead of IP addresses (y/N)</Arg3>
|
||||||
<Arg4>Optional: Server-root-password</Arg4>
|
<Arg4>Optional: Server-Hostnames/Amazon-Instance-Names seperated by commas</Arg4>
|
||||||
|
<Arg5>Optional: Server-root-password</Arg5>
|
||||||
</Cmd48>
|
</Cmd48>
|
||||||
<Cmd49>
|
<Cmd49>
|
||||||
<Name>removeModule</Name>
|
<Name>removeModule</Name>
|
||||||
|
@ -1272,10 +1272,12 @@ void Oam::setSystemConfig(const std::string module, ModuleConfig moduleconfig)
|
|||||||
*
|
*
|
||||||
********************************************************************/
|
********************************************************************/
|
||||||
|
|
||||||
void Oam::addModule(DeviceNetworkList devicenetworklist, const std::string password, const std::string mysqlpw)
|
void Oam::addModule(DeviceNetworkList devicenetworklist, const std::string password, const std::string mysqlpw,
|
||||||
|
bool storeHostnames)
|
||||||
{
|
{
|
||||||
// build and send msg
|
// build and send msg
|
||||||
int returnStatus = sendMsgToProcMgr2(ADDMODULE, devicenetworklist, FORCEFUL, ACK_YES, password, mysqlpw);
|
int returnStatus = sendAddModuleToProcMgr(ADDMODULE, devicenetworklist, FORCEFUL, ACK_YES, storeHostnames,
|
||||||
|
password, mysqlpw);
|
||||||
|
|
||||||
if (returnStatus != API_SUCCESS)
|
if (returnStatus != API_SUCCESS)
|
||||||
exceptionControl("addModule", returnStatus);
|
exceptionControl("addModule", returnStatus);
|
||||||
@ -9929,7 +9931,6 @@ int Oam::sendMsgToProcMgr2(messageqcpp::ByteStream::byte requestType, DeviceNetw
|
|||||||
msg << (ByteStream::byte) gracefulflag;
|
msg << (ByteStream::byte) gracefulflag;
|
||||||
msg << (ByteStream::byte) ackflag;
|
msg << (ByteStream::byte) ackflag;
|
||||||
msg << (ByteStream::byte) requestManual;
|
msg << (ByteStream::byte) requestManual;
|
||||||
|
|
||||||
msg << (uint16_t) devicenetworklist.size();
|
msg << (uint16_t) devicenetworklist.size();
|
||||||
|
|
||||||
DeviceNetworkList::iterator pt = devicenetworklist.begin();
|
DeviceNetworkList::iterator pt = devicenetworklist.begin();
|
||||||
@ -9947,7 +9948,6 @@ int Oam::sendMsgToProcMgr2(messageqcpp::ByteStream::byte requestType, DeviceNetw
|
|||||||
msg << " ";
|
msg << " ";
|
||||||
else
|
else
|
||||||
msg << (*pt).DisableState;
|
msg << (*pt).DisableState;
|
||||||
|
|
||||||
msg << (uint16_t) (*pt).hostConfigList.size();
|
msg << (uint16_t) (*pt).hostConfigList.size();
|
||||||
|
|
||||||
HostConfigList::iterator pt1 = (*pt).hostConfigList.begin();
|
HostConfigList::iterator pt1 = (*pt).hostConfigList.begin();
|
||||||
@ -10007,6 +10007,123 @@ int Oam::sendMsgToProcMgr2(messageqcpp::ByteStream::byte requestType, DeviceNetw
|
|||||||
return returnStatus;
|
return returnStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* A slightly different version of sendMsgToProcMgr2. Add-module needs to send one add'l
|
||||||
|
parameter, and this was the best of a couple bad options. */
|
||||||
|
int Oam::sendAddModuleToProcMgr(messageqcpp::ByteStream::byte requestType, DeviceNetworkList devicenetworklist,
|
||||||
|
GRACEFUL_FLAG gracefulflag, ACK_FLAG ackflag, bool storeHostnames, const std::string password,
|
||||||
|
const std::string mysqlpw)
|
||||||
|
{
|
||||||
|
if (!checkSystemRunning())
|
||||||
|
return API_CONN_REFUSED;
|
||||||
|
|
||||||
|
int returnStatus = API_TIMEOUT; //default
|
||||||
|
ByteStream msg;
|
||||||
|
ByteStream receivedMSG;
|
||||||
|
ByteStream::byte msgType;
|
||||||
|
ByteStream::byte actionType;
|
||||||
|
ByteStream::byte status;
|
||||||
|
|
||||||
|
// get current requesting process, an error will occur if process is a UI tool (not kept in Status Table)
|
||||||
|
// this will be used to determine if this is a manually or auto request down within Process-Monitor
|
||||||
|
bool requestManual;
|
||||||
|
myProcessStatus_t t;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
t = getMyProcessStatus();
|
||||||
|
requestManual = false; // set to auto
|
||||||
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
requestManual = true; // set to manual
|
||||||
|
}
|
||||||
|
|
||||||
|
// setup message
|
||||||
|
msg << (ByteStream::byte) REQUEST;
|
||||||
|
msg << requestType;
|
||||||
|
msg << (std::string) " ";
|
||||||
|
msg << (ByteStream::byte) gracefulflag;
|
||||||
|
msg << (ByteStream::byte) ackflag;
|
||||||
|
msg << (ByteStream::byte) requestManual;
|
||||||
|
msg << (uint8_t) storeHostnames;
|
||||||
|
msg << (uint16_t) devicenetworklist.size();
|
||||||
|
|
||||||
|
DeviceNetworkList::iterator pt = devicenetworklist.begin();
|
||||||
|
|
||||||
|
for ( ; pt != devicenetworklist.end() ; pt++)
|
||||||
|
{
|
||||||
|
msg << (*pt).DeviceName;
|
||||||
|
|
||||||
|
if ( (*pt).UserTempDeviceName.empty() )
|
||||||
|
msg << " ";
|
||||||
|
else
|
||||||
|
msg << (*pt).UserTempDeviceName;
|
||||||
|
|
||||||
|
if ( (*pt).DisableState.empty() )
|
||||||
|
msg << " ";
|
||||||
|
else
|
||||||
|
msg << (*pt).DisableState;
|
||||||
|
msg << (uint16_t) (*pt).hostConfigList.size();
|
||||||
|
|
||||||
|
HostConfigList::iterator pt1 = (*pt).hostConfigList.begin();
|
||||||
|
|
||||||
|
for ( ; pt1 != (*pt).hostConfigList.end() ; pt1++)
|
||||||
|
{
|
||||||
|
msg << (*pt1).IPAddr;
|
||||||
|
msg << (*pt1).HostName;
|
||||||
|
msg << (*pt1).NicID;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
msg << password;
|
||||||
|
msg << mysqlpw;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//send the msg to Process Manager
|
||||||
|
MessageQueueClient procmgr("ProcMgr");
|
||||||
|
procmgr.write(msg);
|
||||||
|
|
||||||
|
// check for Ack msg if needed
|
||||||
|
if ( ackflag == ACK_YES )
|
||||||
|
{
|
||||||
|
// wait 15 minutes for ACK from Process Manager
|
||||||
|
struct timespec ts = { 900, 0 };
|
||||||
|
|
||||||
|
receivedMSG = procmgr.read(&ts);
|
||||||
|
|
||||||
|
if (receivedMSG.length() > 0)
|
||||||
|
{
|
||||||
|
receivedMSG >> msgType;
|
||||||
|
receivedMSG >> actionType;
|
||||||
|
receivedMSG >> status;
|
||||||
|
|
||||||
|
if ( msgType == oam::ACK && actionType == requestType)
|
||||||
|
{
|
||||||
|
// ACK for this request
|
||||||
|
returnStatus = status;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else // timeout
|
||||||
|
returnStatus = API_TIMEOUT;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
// No ACK, assume write success
|
||||||
|
returnStatus = API_SUCCESS;
|
||||||
|
|
||||||
|
// shutdown connection
|
||||||
|
procmgr.shutdown();
|
||||||
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
returnStatus = API_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return returnStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
*
|
*
|
||||||
* Function: sendMsgToProcMgr3
|
* Function: sendMsgToProcMgr3
|
||||||
|
@ -1488,7 +1488,8 @@ public:
|
|||||||
* @param DeviceNetworkConfig the Modules added
|
* @param DeviceNetworkConfig the Modules added
|
||||||
* @param password Host Root Password
|
* @param password Host Root Password
|
||||||
*/
|
*/
|
||||||
EXPORT void addModule(DeviceNetworkList devicenetworklist, const std::string password, const std::string mysqlpw);
|
EXPORT void addModule(DeviceNetworkList devicenetworklist, const std::string password, const std::string mysqlpw,
|
||||||
|
bool storeHostnames);
|
||||||
|
|
||||||
/** @brief remove Module
|
/** @brief remove Module
|
||||||
*
|
*
|
||||||
@ -2503,6 +2504,12 @@ private:
|
|||||||
int sendMsgToProcMgr2(messageqcpp::ByteStream::byte requestType, DeviceNetworkList devicenetworklist,
|
int sendMsgToProcMgr2(messageqcpp::ByteStream::byte requestType, DeviceNetworkList devicenetworklist,
|
||||||
GRACEFUL_FLAG gracefulflag, ACK_FLAG ackflag, const std::string password = oam::UnassignedName, const std::string mysqlpw = oam::UnassignedName);
|
GRACEFUL_FLAG gracefulflag, ACK_FLAG ackflag, const std::string password = oam::UnassignedName, const std::string mysqlpw = oam::UnassignedName);
|
||||||
|
|
||||||
|
/** @brief a slightly different version of sendMsgToProcMgr2, which is for addmodule only.
|
||||||
|
*/
|
||||||
|
int sendAddModuleToProcMgr(messageqcpp::ByteStream::byte requestType, DeviceNetworkList devicenetworklist,
|
||||||
|
GRACEFUL_FLAG gracefulflag, ACK_FLAG ackflag, bool storeHostnames, const std::string password = oam::UnassignedName,
|
||||||
|
const std::string mysqlpw = oam::UnassignedName);
|
||||||
|
|
||||||
/** @brief build and send request message to Process Manager
|
/** @brief build and send request message to Process Manager
|
||||||
* Check for status messages
|
* Check for status messages
|
||||||
*/
|
*/
|
||||||
|
@ -5677,6 +5677,7 @@ int processCommand(string* arguments)
|
|||||||
DeviceNetworkList enabledevicenetworklist;
|
DeviceNetworkList enabledevicenetworklist;
|
||||||
HostConfig hostconfig;
|
HostConfig hostconfig;
|
||||||
|
|
||||||
|
bool storeHostnames = false;
|
||||||
string moduleType;
|
string moduleType;
|
||||||
string moduleName;
|
string moduleName;
|
||||||
int moduleCount;
|
int moduleCount;
|
||||||
@ -5687,12 +5688,12 @@ int processCommand(string* arguments)
|
|||||||
umStorageNames umstoragenames;
|
umStorageNames umstoragenames;
|
||||||
int hostArg;
|
int hostArg;
|
||||||
int dbrootPerPM = 0;
|
int dbrootPerPM = 0;
|
||||||
|
|
||||||
//check if module type or module name was entered
|
//check if module type or module name was entered
|
||||||
if ( arguments[1].size() == 2 )
|
if ( arguments[1].size() == 2 )
|
||||||
{
|
{
|
||||||
//Module Type was entered
|
//Module Type was entered
|
||||||
if (arguments[3] == "" && cloud == oam::UnassignedName)
|
if (arguments[4] == "" && cloud == oam::UnassignedName)
|
||||||
{
|
{
|
||||||
// need at least arguments
|
// need at least arguments
|
||||||
cout << endl << "**** addModule Failed : Missing a required Parameter, enter 'help' for additional information" << endl;
|
cout << endl << "**** addModule Failed : Missing a required Parameter, enter 'help' for additional information" << endl;
|
||||||
@ -5702,8 +5703,47 @@ int processCommand(string* arguments)
|
|||||||
//Module Type was entered
|
//Module Type was entered
|
||||||
moduleType = arguments[1];
|
moduleType = arguments[1];
|
||||||
moduleCount = atoi(arguments[2].c_str());
|
moduleCount = atoi(arguments[2].c_str());
|
||||||
|
hostArg = 4;
|
||||||
|
|
||||||
|
// MCOL-1607. Check whether we should store host names or IP addresses.
|
||||||
|
if (arguments[3] != "" && (arguments[3][0] == 'y' || arguments[3][0] == 'Y'))
|
||||||
|
storeHostnames = true;
|
||||||
|
|
||||||
|
//check for a non-distrubuted install setup, dont need password
|
||||||
|
if ( DistributedInstall != "y" )
|
||||||
|
{
|
||||||
|
if (arguments[5] != "")
|
||||||
|
password = arguments[5];
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cout << endl;
|
||||||
|
string prompt = "Enter the 'User' Password or 'ssh' if configured with ssh-keys";
|
||||||
|
password = dataPrompt(prompt);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (arguments[6] != "")
|
||||||
|
dbrootPerPM = atoi(arguments[6].c_str());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//Module Name was entered
|
||||||
|
if (arguments[2] == "" && cloud == oam::UnassignedName)
|
||||||
|
{
|
||||||
|
// need at least arguments
|
||||||
|
cout << endl << "**** addModule Failed : Missing a required Parameter, enter 'help' for additional information" << endl;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
moduleName = arguments[1];
|
||||||
|
moduleType = arguments[1].substr(0, MAX_MODULE_TYPE_SIZE);
|
||||||
|
moduleCount = 1;
|
||||||
hostArg = 3;
|
hostArg = 3;
|
||||||
|
|
||||||
|
// MCOL-1607. Check whether we should store host names or IP addresses.
|
||||||
|
if (arguments[2] != "" && (arguments[2][0] == 'y' || arguments[2][0] == 'Y'))
|
||||||
|
storeHostnames = true;
|
||||||
|
|
||||||
//check for a non-distrubuted install setup, dont need password
|
//check for a non-distrubuted install setup, dont need password
|
||||||
if ( DistributedInstall != "y" )
|
if ( DistributedInstall != "y" )
|
||||||
{
|
{
|
||||||
@ -5720,37 +5760,6 @@ int processCommand(string* arguments)
|
|||||||
if (arguments[5] != "")
|
if (arguments[5] != "")
|
||||||
dbrootPerPM = atoi(arguments[5].c_str());
|
dbrootPerPM = atoi(arguments[5].c_str());
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
//Module Name was entered
|
|
||||||
if (arguments[2] == "" && cloud == oam::UnassignedName)
|
|
||||||
{
|
|
||||||
// need at least arguments
|
|
||||||
cout << endl << "**** addModule Failed : Missing a required Parameter, enter 'help' for additional information" << endl;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
moduleName = arguments[1];
|
|
||||||
moduleType = arguments[1].substr(0, MAX_MODULE_TYPE_SIZE);
|
|
||||||
moduleCount = 1;
|
|
||||||
hostArg = 2;
|
|
||||||
|
|
||||||
//check for a non-distrubuted install setup, dont need password
|
|
||||||
if ( DistributedInstall != "y" )
|
|
||||||
{
|
|
||||||
if (arguments[3] != "")
|
|
||||||
password = arguments[3];
|
|
||||||
else
|
|
||||||
{
|
|
||||||
cout << endl;
|
|
||||||
string prompt = "Enter the 'User' Password or 'ssh' if configured with ssh-keys";
|
|
||||||
password = dataPrompt(prompt);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (arguments[4] != "")
|
|
||||||
dbrootPerPM = atoi(arguments[4].c_str());
|
|
||||||
}
|
|
||||||
|
|
||||||
//do we needed this check????
|
//do we needed this check????
|
||||||
if ( moduleCount < 1 || moduleCount > 10 )
|
if ( moduleCount < 1 || moduleCount > 10 )
|
||||||
@ -5942,7 +5951,24 @@ int processCommand(string* arguments)
|
|||||||
string hostName;
|
string hostName;
|
||||||
string IPAddress;
|
string IPAddress;
|
||||||
|
|
||||||
if ( cloud == "amazon-ec2")
|
// MCOL-1607. Store hostnames in the config file if they entered one */
|
||||||
|
if (storeHostnames)
|
||||||
|
{
|
||||||
|
// special case
|
||||||
|
if (cloud == "amazon-vpc" && *listPT1 == "autoassign")
|
||||||
|
{
|
||||||
|
hostName = oam::UnassignedName;
|
||||||
|
IPAddress = *listPT1;
|
||||||
|
}
|
||||||
|
else if (oam.isValidIP(*listPT1)) // they entered an IP addr
|
||||||
|
{
|
||||||
|
hostName = oam::UnassignedName;
|
||||||
|
IPAddress = *listPT1;
|
||||||
|
}
|
||||||
|
else // they entered a hostname
|
||||||
|
IPAddress = hostName = *listPT1;
|
||||||
|
}
|
||||||
|
else if ( cloud == "amazon-ec2")
|
||||||
{
|
{
|
||||||
hostName = *listPT1;
|
hostName = *listPT1;
|
||||||
|
|
||||||
@ -5995,14 +6021,13 @@ int processCommand(string* arguments)
|
|||||||
// non-amazon
|
// non-amazon
|
||||||
hostName = *listPT1;
|
hostName = *listPT1;
|
||||||
IPAddress = oam.getIPAddress(hostName);
|
IPAddress = oam.getIPAddress(hostName);
|
||||||
|
|
||||||
if ( IPAddress.empty() )
|
if ( IPAddress.empty() )
|
||||||
{
|
{
|
||||||
// prompt for IP Address
|
// prompt for IP Address
|
||||||
string prompt = "IP Address of " + hostName + " not found, enter IP Address or enter 'abort'";
|
string prompt = "IP Address of " + hostName + " not found, enter IP Address or enter 'abort'";
|
||||||
IPAddress = dataPrompt(prompt);
|
IPAddress = dataPrompt(prompt);
|
||||||
|
|
||||||
if ( IPAddress == "abort" || !oam.isValidIP(IPAddress))
|
if ( IPAddress == "abort" || !oam.isValidIP(IPAddress) )
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -6040,18 +6065,22 @@ int processCommand(string* arguments)
|
|||||||
{
|
{
|
||||||
string prompt = "DataRedundancy is configured for dedicated network, enter a hostname";
|
string prompt = "DataRedundancy is configured for dedicated network, enter a hostname";
|
||||||
DataRedundancyHostname = dataPrompt(prompt);
|
DataRedundancyHostname = dataPrompt(prompt);
|
||||||
DataRedundancyIPAddress = oam.getIPAddress(DataRedundancyHostname);
|
if (storeHostnames)
|
||||||
|
DataRedundancyIPAddress = DataRedundancyHostname;
|
||||||
if ( DataRedundancyIPAddress.empty() )
|
else
|
||||||
{
|
{
|
||||||
// prompt for IP Address
|
DataRedundancyIPAddress = oam.getIPAddress(DataRedundancyHostname);
|
||||||
string prompt = "IP Address of " + DataRedundancyHostname + " not found, enter IP Address";
|
|
||||||
DataRedundancyIPAddress = dataPrompt(prompt);
|
|
||||||
|
|
||||||
if (!oam.isValidIP(DataRedundancyIPAddress))
|
if ( DataRedundancyIPAddress.empty() )
|
||||||
return 1;
|
{
|
||||||
|
// prompt for IP Address
|
||||||
|
string prompt = "IP Address of " + DataRedundancyHostname + " not found, enter IP Address";
|
||||||
|
DataRedundancyIPAddress = dataPrompt(prompt);
|
||||||
|
|
||||||
|
if (!oam.isValidIP(DataRedundancyIPAddress))
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sysConfig->setConfig("DataRedundancyConfig", dataDupHostName, DataRedundancyHostname);
|
sysConfig->setConfig("DataRedundancyConfig", dataDupHostName, DataRedundancyHostname);
|
||||||
sysConfig->setConfig("DataRedundancyConfig", dataDupIPaddr, DataRedundancyIPAddress);
|
sysConfig->setConfig("DataRedundancyConfig", dataDupIPaddr, DataRedundancyIPAddress);
|
||||||
}
|
}
|
||||||
@ -6122,7 +6151,7 @@ int processCommand(string* arguments)
|
|||||||
|
|
||||||
cout << "please wait..." << endl;
|
cout << "please wait..." << endl;
|
||||||
|
|
||||||
oam.addModule(devicenetworklist, password, mysqlpassword);
|
oam.addModule(devicenetworklist, password, mysqlpassword, storeHostnames);
|
||||||
|
|
||||||
cout << "Add Module(s) successfully completed" << endl;
|
cout << "Add Module(s) successfully completed" << endl;
|
||||||
|
|
||||||
|
@ -2205,10 +2205,15 @@ void processMSG(messageqcpp::IOSocket* cfIos)
|
|||||||
|
|
||||||
string value;
|
string value;
|
||||||
uint16_t count, ivalue, nicCount;
|
uint16_t count, ivalue, nicCount;
|
||||||
|
uint8_t tmp8;
|
||||||
oam::DeviceNetworkConfig devicenetworkconfig;
|
oam::DeviceNetworkConfig devicenetworkconfig;
|
||||||
oam::DeviceNetworkList devicenetworklist;
|
oam::DeviceNetworkList devicenetworklist;
|
||||||
oam::HostConfig hostconfig;
|
oam::HostConfig hostconfig;
|
||||||
|
bool storeHostnames;
|
||||||
|
|
||||||
|
msg >> tmp8;
|
||||||
|
storeHostnames = (tmp8 != 0);
|
||||||
|
|
||||||
//get module count to add
|
//get module count to add
|
||||||
msg >> count;
|
msg >> count;
|
||||||
|
|
||||||
@ -2223,7 +2228,7 @@ void processMSG(messageqcpp::IOSocket* cfIos)
|
|||||||
devicenetworkconfig.UserTempDeviceName = value;
|
devicenetworkconfig.UserTempDeviceName = value;
|
||||||
msg >> value;
|
msg >> value;
|
||||||
devicenetworkconfig.DisableState = value;
|
devicenetworkconfig.DisableState = value;
|
||||||
|
|
||||||
msg >> nicCount;
|
msg >> nicCount;
|
||||||
|
|
||||||
for (int j = 0 ; j < nicCount ; j ++ )
|
for (int j = 0 ; j < nicCount ; j ++ )
|
||||||
@ -2244,7 +2249,7 @@ void processMSG(messageqcpp::IOSocket* cfIos)
|
|||||||
string password;
|
string password;
|
||||||
msg >> password;
|
msg >> password;
|
||||||
|
|
||||||
status = processManager.addModule(devicenetworklist, password);
|
status = processManager.addModule(devicenetworklist, password, storeHostnames);
|
||||||
|
|
||||||
log.writeLog(__LINE__, "ADDMODULE: ACK received from Process-Monitor, return status = " + oam.itoa(status));
|
log.writeLog(__LINE__, "ADDMODULE: ACK received from Process-Monitor, return status = " + oam.itoa(status));
|
||||||
}
|
}
|
||||||
@ -4835,7 +4840,8 @@ int ProcessManager::reinitProcessType( std::string processName )
|
|||||||
* purpose: Add Module to system configuration
|
* purpose: Add Module to system configuration
|
||||||
*
|
*
|
||||||
******************************************************************************************/
|
******************************************************************************************/
|
||||||
int ProcessManager::addModule(oam::DeviceNetworkList devicenetworklist, std::string password, bool manualFlag)
|
int ProcessManager::addModule(oam::DeviceNetworkList devicenetworklist, std::string password, bool storeHostnames,
|
||||||
|
bool manualFlag)
|
||||||
{
|
{
|
||||||
ProcessLog log;
|
ProcessLog log;
|
||||||
Configuration config;
|
Configuration config;
|
||||||
@ -5262,7 +5268,10 @@ int ProcessManager::addModule(oam::DeviceNetworkList devicenetworklist, std::str
|
|||||||
}
|
}
|
||||||
|
|
||||||
hostconfig.HostName = hostName;
|
hostconfig.HostName = hostName;
|
||||||
hostconfig.IPAddr = IPAddr;
|
if (storeHostnames)
|
||||||
|
hostconfig.IPAddr = hostName;
|
||||||
|
else
|
||||||
|
hostconfig.IPAddr = IPAddr;
|
||||||
hostconfig.NicID = (*pt1).NicID;
|
hostconfig.NicID = (*pt1).NicID;
|
||||||
devicenetworkconfig.hostConfigList.push_back(hostconfig);
|
devicenetworkconfig.hostConfigList.push_back(hostconfig);
|
||||||
}
|
}
|
||||||
|
@ -416,7 +416,8 @@ public:
|
|||||||
/**
|
/**
|
||||||
*@brief Add Module
|
*@brief Add Module
|
||||||
*/
|
*/
|
||||||
int addModule(oam::DeviceNetworkList devicenetworklist, std::string password, bool manualFlag = true);
|
int addModule(oam::DeviceNetworkList devicenetworklist, std::string password, bool storeHostnames,
|
||||||
|
bool manualFlag = true);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*@brief Configure Module
|
*@brief Configure Module
|
||||||
|
Reference in New Issue
Block a user