From 3c5645c730a430549cdb21d7e427a5f79df6a8a9 Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Tue, 28 Oct 2014 10:24:19 +0100 Subject: [PATCH] Cli: Add zone attribute for 'agent update-config' command refs #7248 --- lib/cli/agentupdateconfigcommand.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/cli/agentupdateconfigcommand.cpp b/lib/cli/agentupdateconfigcommand.cpp index ca51e2ead..6f5e7d20e 100644 --- a/lib/cli/agentupdateconfigcommand.cpp +++ b/lib/cli/agentupdateconfigcommand.cpp @@ -73,6 +73,7 @@ int AgentUpdateConfigCommand::Run(const boost::program_options::variables_map& v BOOST_FOREACH(const Dictionary::Ptr& agent, AgentUtility::GetAgents()) { Dictionary::Ptr repository = agent->Get("repository"); + String zone = agent->Get("zone"); ObjectLock olock(repository); BOOST_FOREACH(const Dictionary::Pair& kv, repository) { @@ -81,6 +82,7 @@ int AgentUpdateConfigCommand::Run(const boost::program_options::variables_map& v /* add a new host to the config repository */ Dictionary::Ptr host_attrs = make_shared(); host_attrs->Set("check_command", "dummy"); //TODO: add a repository-host template + host_attrs->Set("zone", zone); if (!RepositoryUtility::AddObject(host, "Host", host_attrs)) { Log(LogCritical, "cli") @@ -96,6 +98,7 @@ int AgentUpdateConfigCommand::Run(const boost::program_options::variables_map& v Dictionary::Ptr service_attrs = make_shared(); service_attrs->Set("host_name", host); //Required for host-service relation service_attrs->Set("check_command", "dummy"); //TODO: add a repository-service template + service_attrs->Set("zone", zone); if (!RepositoryUtility::AddObject(service, "Service", service_attrs)) { Log(LogCritical, "cli")