]> granicus.if.org Git - icinga2/commitdiff
Refactor code
authorJean-Marcel Flach <jean-marcel.flach@netways.de>
Mon, 20 Apr 2015 09:01:27 +0000 (11:01 +0200)
committerGunnar Beutner <gunnar@beutner.name>
Mon, 20 Apr 2015 09:45:01 +0000 (11:45 +0200)
fixes #9112

lib/cli/troubleshootcommand.cpp
lib/cli/troubleshootcommand.hpp

index 8b4d91eec5ff8369df1b745369c98463fce69510..8e63904d516351a18099d092eac7f766cc6d3cce 100644 (file)
@@ -253,14 +253,14 @@ bool TroubleshootCommand::ConfigInfo(InfoLog& log, const boost::program_options:
        InfoLogLine(log)
            << "A collection of important configuration files follows, please make sure to remove any sensitive data such as credentials, internal company names, etc\n";
 
-       if (!PrintConf(log, Application::GetSysconfDir() + "/icinga2/icinga2.conf")) {
+       if (!PrintFile(log, Application::GetSysconfDir() + "/icinga2/icinga2.conf")) {
                InfoLogLine(log, 0, LogWarning)
                    << "icinga2.conf not found, therefore skipping validation.\n"
                    << "If you are using an icinga2.conf somewhere but the default path please validate it via 'icinga2 daemon -C -c \"path\to/icinga2.conf\"'\n"
                    << "and provide it with your support request.\n";
        }
 
-       if (!PrintConf(log, Application::GetSysconfDir() + "/icinga2/zones.conf")) {
+       if (!PrintFile(log, Application::GetSysconfDir() + "/icinga2/zones.conf")) {
                InfoLogLine(log, 0, LogWarning)
                    << "zones.conf not found.\n"
                    << "If you are using a zones.conf somewhere but the default path please provide it with your support request\n";
@@ -410,7 +410,7 @@ bool TroubleshootCommand::PrintCrashReports(InfoLog& log)
                InfoLogLine(log)
                    << "Latest crash report is from " << Utility::FormatDateTime("%Y-%m-%d %H:%M:%S", Utility::GetTime()) << '\n'
                    << "File: " << bestFilename << "\n\n";
-               PrintConf(log, bestFilename);
+               PrintFile(log, bestFilename);
                InfoLogLine(log)
                    << '\n';
        }
@@ -418,7 +418,7 @@ bool TroubleshootCommand::PrintCrashReports(InfoLog& log)
        return true;
 }
 
-bool TroubleshootCommand::PrintConf(InfoLog& log, const String& path)
+bool TroubleshootCommand::PrintFile(InfoLog& log, const String& path)
 {
        std::ifstream text;
        text.open(path.CStr(), std::ifstream::in);
index b336baffe83669b829b53a07688f3a9a9ac589d3..d1cb1c7b18c09ccc9b6628fd06707c9a7dd8d67c 100644 (file)
@@ -58,7 +58,7 @@ private:
        static bool CheckFeatures(InfoLog& log);
        static void GetLatestReport(const String& filename, time_t& bestTimestamp, String& bestFilename);
        static bool PrintCrashReports(InfoLog& log);
-       static bool PrintConf(InfoLog& log, const String& path);
+       static bool PrintFile(InfoLog& log, const String& path);
        static bool CheckConfig(void);
        static void CheckObjectFile(const String& objectfile, InfoLog& log, InfoLog *OFile, const bool objectConsole,
            Dictionary::Ptr& logs, std::set<String>& configs);