]> granicus.if.org Git - icinga2/commitdiff
CLI: Make sure that en/disable errors are marked as such
authorMichael Friedrich <michael.friedrich@netways.de>
Tue, 14 Oct 2014 17:41:32 +0000 (19:41 +0200)
committerMichael Friedrich <michael.friedrich@netways.de>
Tue, 14 Oct 2014 17:41:32 +0000 (19:41 +0200)
fixes #7379

lib/cli/featuredisablecommand.cpp
lib/cli/featureenablecommand.cpp

index 725c0c5c12b9525730c6ba6b816699c853a3c5bf..1dbc6dbbfbc954fa129579d1db4b280101468755 100644 (file)
@@ -88,6 +88,8 @@ int FeatureDisableCommand::Run(const boost::program_options::variables_map& vm,
                 if (unlink(target.CStr()) < 0) {
                        Log(LogCritical, "cli", "Cannot disable feature '" + feature + "'. Unlinking target file '" + target +
                            "' failed with error code " + Convert::ToString(errno) + ", \"" + Utility::FormatErrorNumber(errno) + "\".");
+                        errors.push_back(feature);
+                        continue;
                }
 
                 Log(LogInformation, "cli", "Disabling feature " + feature + " in '" + features_enabled_dir + "'.");
index 13b8b87c90e50e12a317e36fbf611510ff3a106a..e7375bbadb290070d0c5d03d963498bbe81db18b 100644 (file)
@@ -101,6 +101,8 @@ int FeatureEnableCommand::Run(const boost::program_options::variables_map& vm, c
                 if (symlink(source.CStr(), target.CStr()) < 0) {
                        Log(LogCritical, "cli", "Cannot enable feature '" + feature + "'. Linking source '" + source + "' to target file '" + target +
                            "' failed with error code " + Convert::ToString(errno) + ", \"" + Utility::FormatErrorNumber(errno) + "\".");
+                        errors.push_back(feature);
+                        continue;
                }
 
                 Log(LogInformation, "cli", "Enabling feature '" + feature + "' in '" + features_enabled_dir + "'.");