Use the NodeName constant in 'api setup'

fixes #10641
This commit is contained in:
Gunnar Beutner 2015-11-26 08:09:24 +01:00
parent bf97d7cc57
commit 05af1cba0d
1 changed files with 7 additions and 1 deletions

View File

@ -19,6 +19,7 @@
#include "cli/apisetupcommand.hpp" #include "cli/apisetupcommand.hpp"
#include "cli/apisetuputility.hpp" #include "cli/apisetuputility.hpp"
#include "cli/variableutility.hpp"
#include "base/logger.hpp" #include "base/logger.hpp"
#include "base/console.hpp" #include "base/console.hpp"
#include <iostream> #include <iostream>
@ -55,7 +56,12 @@ int ApiSetupCommand::GetMaxArguments(void) const
*/ */
int ApiSetupCommand::Run(const boost::program_options::variables_map& vm, const std::vector<std::string>& ap) const int ApiSetupCommand::Run(const boost::program_options::variables_map& vm, const std::vector<std::string>& ap) const
{ {
if (!ApiSetupUtility::SetupMaster(Utility::GetFQDN(), true)) String cn = VariableUtility::GetVariable("NodeName");
if (cn.IsEmpty())
cn = Utility::GetFQDN();
if (!ApiSetupUtility::SetupMaster(cn, true))
return 1; return 1;
return 0; return 0;