projects
/
icinga2
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c719333
)
Implement support for removing more than one agent
author
Gunnar Beutner
<gunnar@beutner.name>
Fri, 24 Oct 2014 10:16:14 +0000
(12:16 +0200)
committer
Gunnar Beutner
<gunnar@beutner.name>
Fri, 24 Oct 2014 10:18:24 +0000
(12:18 +0200)
refs #7248
lib/cli/agentremovecommand.cpp
patch
|
blob
|
history
diff --git
a/lib/cli/agentremovecommand.cpp
b/lib/cli/agentremovecommand.cpp
index b6014626bf7b0d87b2cceca1ff5e0e2a7fd2ce09..ddc3dc69897bb31dc2bd3c9624187608868541cc 100644
(file)
--- a/
lib/cli/agentremovecommand.cpp
+++ b/
lib/cli/agentremovecommand.cpp
@@
-60,10
+60,17
@@
int AgentRemoveCommand::Run(const boost::program_options::variables_map& vm, con
return 1;
}
- if (!AgentUtility::RemoveAgent(ap[0])) {
- Log(LogCritical, "cli", "Cannot remove agent '" + ap[0] + "'.");
- return 1;
+ bool failed = false;
+
+ BOOST_FOREACH(const String& agent, ap) {
+ if (!AgentUtility::RemoveAgent(agent)) {
+ Log(LogCritical, "cli", "Cannot remove agent '" + ap[0] + "'.");
+ failed = true;
+ }
}
- return 0;
+ if (failed)
+ return 1;
+ else
+ return 0;
}