diff --git a/conf/datasid-conf.json b/conf/datasid-conf.json index 4d0afac29b04226df1ba085b17336951631a8afe..a15e0241b1ce4b63b270213ecca8e95fc8838ef4 100644 --- a/conf/datasid-conf.json +++ b/conf/datasid-conf.json @@ -1,5 +1,5 @@ { - "idPoint" : "%d", + "idPoint" : "%s", "project" : "%s", "proxyConf" : "%s", "version" : "%s", diff --git a/include/agent/parse_config_file.h b/include/agent/parse_config_file.h index 96ed99f265186a3d742e27f71241db126b455d28..49dceb2444229d9da6504772761219f842cddd12 100644 --- a/include/agent/parse_config_file.h +++ b/include/agent/parse_config_file.h @@ -6,7 +6,7 @@ #include <agent/parse.h> #include <json/json.h> -/** +/** * @file parse_config_file.h * @brief This file has a Conf class - The main purpose is get config file content and make parse to set in a conf object */ @@ -15,20 +15,20 @@ class Agent; class Conf{ private: - int idPoint; + std::string idPoint; std::string pathProxyFile; /*!< Absolute path from proxy file. */ std::string webService; /*!< url from web service. */ std::string version; /*!< Current agent version */ std::string project; public: - void setIdPoint(int); + void setIdPoint(std::string); void setPathProxyFile(std::string); void setWebService(std::string); void setVersion(std::string); void setProject(std::string); - int getIdPoint() const; + std::string getIdPoint() const; std::string getPathProxyFile() const; std::string getWebService() const; std::string getVersion() const; @@ -38,7 +38,7 @@ class Conf{ bool parse_config_file(Agent*); -/** +/** * @file parse_config_file.h * @brief This file has a Conf class - The main purpose is get config file content and make parse to set in a conf object */ diff --git a/src/agent/get.cpp b/src/agent/get.cpp index f9f650b57022d9562240ca7b321e0dc6f7b368fd..e06472f820997956c7427689b04e6506c1dc188a 100644 --- a/src/agent/get.cpp +++ b/src/agent/get.cpp @@ -140,7 +140,7 @@ bool get_agent_installer_name(Agent* agent, std::string* filename, bool opt) { std::string ws = agent->getConf()->getWebService() + std::string("/api/agent/install/") + std::string(os) + std::string("/") - + std::to_string(agent->getConf()->getIdPoint()); + + agent->getConf()->getIdPoint(); if (opt) status_code = agent->getConnection()->getInstallerName(ws, agent, filename, opt); // NOLINT [whitespace/line_length] @@ -208,7 +208,7 @@ void execute_agent(Agent* agent, boost::filesystem::path tmp) { } -/** +/** * @file get.cpp * @brief Check case if has a new agent version available */ diff --git a/src/agent/parse_config_file.cpp b/src/agent/parse_config_file.cpp index 394bcc63dab02e0398a120db8adb8e2ac2675d5d..f0fb776423054f523b2d347ddea4164b44df7427 100644 --- a/src/agent/parse_config_file.cpp +++ b/src/agent/parse_config_file.cpp @@ -29,7 +29,7 @@ /** Set id Point */ -void Conf::setIdPoint(int i) { +void Conf::setIdPoint(std::string i) { this->idPoint = i; } @@ -43,7 +43,7 @@ void Conf::setWebService(std::string web) { this->webService = web; } -/** Get the agent version from config file, at conf directory, +/** Get the agent version from config file, at conf directory, * and setted the version attribute. */ void Conf::setVersion(std::string v) { this->version = v; @@ -55,7 +55,7 @@ void Conf::setProject(std::string p) { } /** Return id Point */ -int Conf::getIdPoint() const { +std::string Conf::getIdPoint() const { return this->idPoint; } @@ -79,8 +79,8 @@ std::string Conf::getProject() const { return this->project; } -/** - * After parse the config file, get the values from map variable and set at conf object +/** + * After parse the config file, get the values from map variable and set at conf object */ bool set_conf_object(Agent* agent, std::map<std::string, std::string>* content) { @@ -91,15 +91,15 @@ bool set_conf_object(Agent* agent, std::map<std::string, content->count("PROJECT") == 0 ) return false; - /* - * agent.getPrefix() contains the absolute path from agent + /* + * agent.getPrefix() contains the absolute path from agent */ std::string pathProxyFile = agent->getPrefix() + std::string("/") + (*content)["PROXYCONF"]; std::string webService = (*content)["WEBSERVICE"]; std::string version = (*content)["VERSION"]; std::string project = (*content)["PROJECT"]; - int idPoint = atoi((*content)["IDPOINT"].c_str()); + std::string idPoint = (*content)["IDPOINT"].c_str(); agent->getConf()->setPathProxyFile(pathProxyFile); agent->getConf()->setWebService(webService); @@ -125,7 +125,7 @@ bool parse_config_file(Agent* agent) { return true; } -/** +/** * @file parse_config_file.cpp * @brief This file contain the implementation from Conf's method - The main purpose is get config file content and * make parse to set in a conf object