CLI: Make sure that en/disable errors are marked as such

fixes #7379
This commit is contained in:
Michael Friedrich 2014-10-14 19:41:32 +02:00
parent d7d6d6096f
commit 9df1b6bc1c
2 changed files with 4 additions and 0 deletions

View File

@ -88,6 +88,8 @@ int FeatureDisableCommand::Run(const boost::program_options::variables_map& vm,
if (unlink(target.CStr()) < 0) { if (unlink(target.CStr()) < 0) {
Log(LogCritical, "cli", "Cannot disable feature '" + feature + "'. Unlinking target file '" + target + Log(LogCritical, "cli", "Cannot disable feature '" + feature + "'. Unlinking target file '" + target +
"' failed with error code " + Convert::ToString(errno) + ", \"" + Utility::FormatErrorNumber(errno) + "\"."); "' 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 + "'."); Log(LogInformation, "cli", "Disabling feature " + feature + " in '" + features_enabled_dir + "'.");

View File

@ -101,6 +101,8 @@ int FeatureEnableCommand::Run(const boost::program_options::variables_map& vm, c
if (symlink(source.CStr(), target.CStr()) < 0) { if (symlink(source.CStr(), target.CStr()) < 0) {
Log(LogCritical, "cli", "Cannot enable feature '" + feature + "'. Linking source '" + source + "' to target file '" + target + Log(LogCritical, "cli", "Cannot enable feature '" + feature + "'. Linking source '" + source + "' to target file '" + target +
"' failed with error code " + Convert::ToString(errno) + ", \"" + Utility::FormatErrorNumber(errno) + "\"."); "' 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 + "'."); Log(LogInformation, "cli", "Enabling feature '" + feature + "' in '" + features_enabled_dir + "'.");