mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-25 06:34:42 +02:00
parent
844defd362
commit
123f7fd552
@ -115,6 +115,7 @@ int NodeUpdateConfigCommand::Run(const boost::program_options::variables_map& vm
|
||||
Dictionary::Ptr old_node = old_node_objs.second;
|
||||
Dictionary::Ptr old_node_repository = old_node->Get("repository");
|
||||
|
||||
if (old_node_repository) {
|
||||
ObjectLock olock(old_node_repository);
|
||||
BOOST_FOREACH(const Dictionary::Pair& kv, old_node_repository) {
|
||||
String host = kv.first;
|
||||
@ -123,6 +124,7 @@ int NodeUpdateConfigCommand::Run(const boost::program_options::variables_map& vm
|
||||
host_attrs->Set("name", host);
|
||||
RepositoryUtility::RemoveObject(host, "Host", host_attrs); //this removes all services for this host as well
|
||||
}
|
||||
}
|
||||
|
||||
String zone = old_node->Get("zone");
|
||||
String endpoint = old_node->Get("endpoint");
|
||||
@ -142,6 +144,7 @@ int NodeUpdateConfigCommand::Run(const boost::program_options::variables_map& vm
|
||||
Dictionary::Ptr old_node = old_node_objs.second;
|
||||
Dictionary::Ptr old_node_repository = old_node->Get("repository");
|
||||
|
||||
if (old_node_repository) {
|
||||
ObjectLock xlock(old_node_repository);
|
||||
BOOST_FOREACH(const Dictionary::Pair& kv, old_node_repository) {
|
||||
String old_host = kv.first;
|
||||
@ -199,6 +202,7 @@ int NodeUpdateConfigCommand::Run(const boost::program_options::variables_map& vm
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* next iterate over all nodes and add hosts/services */
|
||||
BOOST_FOREACH(const Dictionary::Ptr& node, nodes) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user