]> granicus.if.org Git - icinga2/commitdiff
Allow to pass cn to ApiSetupUtility::SetupMaster()
authorMichael Friedrich <michael.friedrich@netways.de>
Thu, 25 Jun 2015 08:40:50 +0000 (10:40 +0200)
committerMichael Friedrich <michael.friedrich@netways.de>
Thu, 25 Jun 2015 08:40:50 +0000 (10:40 +0200)
refs #9471

lib/cli/apisetupcommand.cpp
lib/cli/apisetuputility.cpp
lib/cli/apisetuputility.hpp

index 5bad6d710d81b8f3d9ac4e0cb0d7789980f25732..47738006c1f0e3dcc145b823c417938f1c86c61f 100644 (file)
@@ -60,7 +60,7 @@ int ApiSetupCommand::Run(const boost::program_options::variables_map& vm, const
         * - setup the api on a client?
         */
 
-       int result = ApiSetupUtility::SetupMaster();
+       int result = ApiSetupUtility::SetupMaster(Utility::GetFQDN());
 
        if (result > 0) {
                Log(LogCritical, "ApiSetup", "Error occured. Bailing out.");
index 5694d7059d3b15e5804c4c1517871f8458980f4e..0c7ed775f39a8bc6ccb23a235fd4a5661ad3b05b 100644 (file)
@@ -43,7 +43,7 @@ String ApiSetupUtility::GetConfdPath(void)
         return Application::GetSysconfDir() + "/icinga2/conf.d";
 }
 
-int ApiSetupUtility::SetupMaster(void)
+int ApiSetupUtility::SetupMaster(const String& cn)
 {
        /* if the 'api' feature is enabled we can safely assume
         * that either 'api setup' was run, or the user manually
@@ -58,8 +58,6 @@ int ApiSetupUtility::SetupMaster(void)
        Log(LogInformation, "cli")
            << "Generating new CA.\n";
 
-       String cn = Utility::GetFQDN();
-
        if (PkiUtility::NewCa() > 0) {
                Log(LogWarning, "cli", "Found CA, skipping and using the existing one.");
        }
index eb5a1321c1ae442b9ae0af8a7f86195e7e79ae44..ce8ceb8dd48865530080197eb42708f9433fb951 100644 (file)
@@ -37,7 +37,7 @@ namespace icinga
 class I2_CLI_API ApiSetupUtility
 {
 public:
-       static int SetupMaster(void);
+       static int SetupMaster(const String& cn);
        static String GetConfdPath(void);
 
 private: