Merge "Deprovision mtcClient bmc info when bmc for node is deprovisioned"
This commit is contained in:
@@ -506,27 +506,23 @@ int mtc_service_inbox ( nodeLinkClass * obj_ptr,
|
|||||||
}
|
}
|
||||||
obj_ptr->declare_service_ready ( hostname, MTC_SERVICE_MTCCLIENT, features );
|
obj_ptr->declare_service_ready ( hostname, MTC_SERVICE_MTCCLIENT, features );
|
||||||
|
|
||||||
/* if this ready event is from the mtcClient of a
|
/* The mtcInfo in this context currently only contains
|
||||||
* controller that has valid bmc access info then
|
* bmc provisioning info for the purpose of telling
|
||||||
* build the 'peer controller kill' mtcInfo and
|
* the mtcClient what its peer bmc priovisioning data is.
|
||||||
* send it to that mtcClient */
|
*
|
||||||
if ( obj_ptr->get_nodetype ( hostname ) & CONTROLLER_TYPE )
|
* No need to send this on an SX system as there
|
||||||
|
* is no peer controller.
|
||||||
|
*
|
||||||
|
* The network check avoids sending duplicate on
|
||||||
|
* the pxeboot network.
|
||||||
|
*
|
||||||
|
* Only applies to mtcClients that run on controllers */
|
||||||
|
if (( iface == MGMNT_INTERFACE ) &&
|
||||||
|
( obj_ptr->system_type != SYSTEM_TYPE__AIO__SIMPLEX ) &&
|
||||||
|
( obj_ptr->get_nodetype ( hostname ) & CONTROLLER_TYPE ))
|
||||||
{
|
{
|
||||||
string bm_pw = obj_ptr->get_bm_pw ( hostname ) ;
|
send_mtc_cmd ( hostname, MTC_MSG_INFO, MGMNT_INTERFACE,
|
||||||
if ( !bm_pw.empty() && ( bm_pw != NONE ))
|
obj_ptr->build_mtcInfo_dict ( MTC_INFO_CODE__PEER_CONTROLLER_KILL_INFO));
|
||||||
{
|
|
||||||
string bm_un = obj_ptr->get_bm_un ( hostname ) ;
|
|
||||||
string bm_ip = obj_ptr->get_bm_ip ( hostname ) ;
|
|
||||||
if (( hostUtil_is_valid_username ( bm_un )) &&
|
|
||||||
( hostUtil_is_valid_ip_addr ( bm_ip )))
|
|
||||||
{
|
|
||||||
send_mtc_cmd ( hostname,
|
|
||||||
MTC_MSG_INFO,
|
|
||||||
MGMNT_INTERFACE,
|
|
||||||
obj_ptr->build_mtcInfo_dict (
|
|
||||||
MTC_INFO_CODE__PEER_CONTROLLER_KILL_INFO));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return (PASS);
|
return (PASS);
|
||||||
}
|
}
|
||||||
|
@@ -2459,16 +2459,20 @@ void load_mtcInfo_msg ( mtc_message_type & msg )
|
|||||||
peer_controller.bm_un = jsonUtil_get_key_value_string(ctrl_obj, "bm_un");
|
peer_controller.bm_un = jsonUtil_get_key_value_string(ctrl_obj, "bm_un");
|
||||||
peer_controller.bm_pw = jsonUtil_get_key_value_string(ctrl_obj, "bm_pw");
|
peer_controller.bm_pw = jsonUtil_get_key_value_string(ctrl_obj, "bm_pw");
|
||||||
|
|
||||||
/* log the mc info but not the bmc password ; only
|
/* Log the mc info but not the bmc password.
|
||||||
* indicate that it looks 'ok' or 'is 'none' */
|
* Only indicate that it looks 'ok' or 'is 'none'.
|
||||||
ilog ("%s is my peer [host:%s bmc:%s:%s:%s]",
|
* However, don't log if the bmc ip is none */
|
||||||
peer_controller.hostname.c_str(),
|
if ( peer_controller.bm_ip.compare("none") )
|
||||||
peer_controller.host_ip.c_str(),
|
{
|
||||||
peer_controller.bm_ip.c_str(),
|
ilog ("%s is my peer [host:%s bmc:%s:%s:%s]",
|
||||||
peer_controller.bm_un.c_str(),
|
peer_controller.hostname.c_str(),
|
||||||
hostUtil_is_valid_pw(peer_controller.bm_pw) ? "ok":"none");
|
peer_controller.host_ip.c_str(),
|
||||||
|
peer_controller.bm_ip.c_str(),
|
||||||
|
peer_controller.bm_un.c_str(),
|
||||||
|
hostUtil_is_valid_pw(peer_controller.bm_pw) ? "ok":"none");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else if ( ctrl.system_type != SYSTEM_TYPE__AIO__SIMPLEX )
|
||||||
{
|
{
|
||||||
wlog("peer mtcInfo missing (rc:%d) ; %s",
|
wlog("peer mtcInfo missing (rc:%d) ; %s",
|
||||||
json_rc, &msg.buf[0]);
|
json_rc, &msg.buf[0]);
|
||||||
|
Reference in New Issue
Block a user