mirror of https://github.com/Icinga/icinga2.git
Replace std::vector:push_back with initializer list
This replaces a few std::vector::push_back calls with initializer lists.
This commit is contained in:
parent
3043a190ca
commit
592d1c7d7e
|
@ -158,15 +158,12 @@ int NodeSetupCommand::SetupMaster(const boost::program_options::variables_map& v
|
|||
/* write zones.conf and update with zone + endpoint information */
|
||||
Log(LogInformation, "cli", "Generating zone and object configuration.");
|
||||
|
||||
std::vector<String> globalZones;
|
||||
std::vector<String> globalZones { "global-templates", "director-global" };
|
||||
std::vector<std::string> setupGlobalZones;
|
||||
|
||||
if (vm.count("global_zones"))
|
||||
setupGlobalZones = vm["global_zones"].as<std::vector<std::string> >();
|
||||
|
||||
globalZones.push_back("global-templates");
|
||||
globalZones.push_back("director-global");
|
||||
|
||||
for (int i = 0; i < setupGlobalZones.size(); i++) {
|
||||
if (std::find(globalZones.begin(), globalZones.end(), setupGlobalZones[i]) != globalZones.end()) {
|
||||
Log(LogCritical, "cli")
|
||||
|
@ -429,15 +426,12 @@ int NodeSetupCommand::SetupNode(const boost::program_options::variables_map& vm,
|
|||
|
||||
Log(LogInformation, "cli", "Generating zone and object configuration.");
|
||||
|
||||
std::vector<String> globalZones;
|
||||
std::vector<String> globalZones { "global-templates", "director-global" };
|
||||
std::vector<std::string> setupGlobalZones;
|
||||
|
||||
if (vm.count("global_zones"))
|
||||
setupGlobalZones = vm["global_zones"].as<std::vector<std::string> >();
|
||||
|
||||
globalZones.push_back("global-templates");
|
||||
globalZones.push_back("director-global");
|
||||
|
||||
for (int i = 0; i < setupGlobalZones.size(); i++) {
|
||||
if (std::find(globalZones.begin(), globalZones.end(), setupGlobalZones[i]) != globalZones.end()) {
|
||||
Log(LogCritical, "cli")
|
||||
|
|
|
@ -499,10 +499,7 @@ wizard_ticket:
|
|||
/* apilistener config */
|
||||
Log(LogInformation, "cli", "Generating local zones.conf.");
|
||||
|
||||
std::vector<String> globalZones;
|
||||
|
||||
globalZones.push_back("global-templates");
|
||||
globalZones.push_back("director-global");
|
||||
std::vector<String> globalZones { "global-templates", "director-global" };
|
||||
|
||||
std::cout << "\nDo you want to specify additional global zones? [y/N]: ";
|
||||
|
||||
|
@ -633,10 +630,7 @@ int NodeWizardCommand::MasterSetup() const
|
|||
else
|
||||
std::cout << "'api' feature already enabled.\n";
|
||||
|
||||
std::vector<String> globalZones;
|
||||
|
||||
globalZones.push_back("global-templates");
|
||||
globalZones.push_back("director-global");
|
||||
std::vector<String> globalZones { "global-templates", "director-global" };
|
||||
|
||||
std::cout << "\nDo you want to specify additional global zones? [y/N]: ";
|
||||
|
||||
|
|
Loading…
Reference in New Issue