Commit 4792319a authored by Lucas Fernandes de Oliveira's avatar Lucas Fernandes de Oliveira

Merge branch '21-mudar-idpoint-para-string' into 'development'

Resolve "Mudar idPoint para string"

See merge request !117
parents 7ad87297 7b124d35
Pipeline #22056 passed with stages
in 34 minutes and 35 seconds
{
"idPoint" : "%d",
"idPoint" : "%s",
"project" : "%s",
"proxyConf" : "%s",
"version" : "%s",
......
......@@ -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
*/
......
......@@ -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
*/
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment