2011-09-06 Vanessa Gil <vanessa.gil@artica.es>

* win32/pandora_agent_conf.php: Fixed error creating broker agent.


git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4918 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
vgilc 2011-09-06 13:59:35 +00:00
parent c308960751
commit af3aba90c2
2 changed files with 10 additions and 5 deletions

View File

@ -1,3 +1,7 @@
2011-09-06 Vanessa Gil <vanessa.gil@artica.es>
* win32/pandora_agent_conf.php: Fixed error creating broker agent.
2011-09-05 Ramon Novoa <rnovoa@artica.es> 2011-09-05 Ramon Novoa <rnovoa@artica.es>
* unix/plugins/inventory: Added support for hwinfo. * unix/plugins/inventory: Added support for hwinfo.

View File

@ -109,7 +109,7 @@ Pandora::Pandora_Agent_Conf::parseFile(string path_file, Collection *aux){
void void
writeBrokerConf(string path_broker, string filename, string name_broker){ writeBrokerConf(string path_broker, string filename, string name_broker){
ifstream file_conf (filename.c_str ()); ifstream file_conf (filename.c_str ());
ofstream file_broker (path_broker.c_str ()); ofstream file_broker ((Pandora::getPandoraInstallDir ()+path_broker).c_str ());
string buffer; string buffer;
string comp; string comp;
unsigned int pos; unsigned int pos;
@ -199,12 +199,13 @@ Pandora::Pandora_Agent_Conf::setFile (string *all_conf){
all_conf[position] = Pandora::getPandoraInstallDir () + path_broker; all_conf[position] = Pandora::getPandoraInstallDir () + path_broker;
position += 1; position += 1;
ifstream file_br (path_broker.c_str ()); ifstream file_br ((Pandora::getPandoraInstallDir () + path_broker).c_str ());
/* Check if already exists the configuration file*/ /* Check if already exists the configuration file*/
if (!file_br){ if (!file_br.is_open()){
file_br.close();
writeBrokerConf(path_broker, filename, name_broker); writeBrokerConf(path_broker, filename, name_broker);
} } else {
file_br.close();
}
} }
/*Check if is a collection*/ /*Check if is a collection*/