2008-03-14 Ramon Novoa <rnovoa@artica.es>
* win32/pandora_windows_service.cc: Added support for Tentacle file transfers. * win32/pandora_windows_service.h: Added support for Tentacle file transfers. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@750 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
6b0cc12795
commit
daaca58b6a
|
@ -1,3 +1,8 @@
|
||||||
|
2008-03-14 Ramon Novoa <rnovoa@artica.es>
|
||||||
|
|
||||||
|
* win32/pandora_windows_service.cc: Added support for Tentacle file transfers.
|
||||||
|
* win32/pandora_windows_service.h: Added support for Tentacle file transfers.
|
||||||
|
|
||||||
2008-03-11 Ramon Novoa <rnovoa@artica.es>
|
2008-03-11 Ramon Novoa <rnovoa@artica.es>
|
||||||
|
|
||||||
* linux/pandora_agent: Added support for Tentacle file transfers.
|
* linux/pandora_agent: Added support for Tentacle file transfers.
|
||||||
|
|
|
@ -160,6 +160,74 @@ Pandora_Windows_Service::getXmlHeader () {
|
||||||
return agent;
|
return agent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Pandora_Windows_Service::copyTentacleDataFile (string host,
|
||||||
|
string filename)
|
||||||
|
{
|
||||||
|
int rc;
|
||||||
|
string var, filepath;
|
||||||
|
string pubkey_file, privkey_file;
|
||||||
|
string tentacle_cmd;
|
||||||
|
|
||||||
|
var = conf->getValue ("temporal");
|
||||||
|
if (var[var.length () - 1] != '\\') {
|
||||||
|
var += "\\";
|
||||||
|
}
|
||||||
|
|
||||||
|
filepath = var + filename;
|
||||||
|
|
||||||
|
/* Build the command to launch the Tentacle client */
|
||||||
|
tentacle_cmd = "tentacle_client.exe -a " + host;
|
||||||
|
|
||||||
|
var = conf->getValue ("server_port");
|
||||||
|
if (var != "") {
|
||||||
|
tentacle_cmd += " -p " + var;
|
||||||
|
}
|
||||||
|
|
||||||
|
var = conf->getValue ("server_ssl");
|
||||||
|
if (var == "1") {
|
||||||
|
tentacle_cmd += " -c";
|
||||||
|
}
|
||||||
|
|
||||||
|
var = conf->getValue ("server_pwd");
|
||||||
|
if (var != "") {
|
||||||
|
tentacle_cmd += " -x " + var;
|
||||||
|
}
|
||||||
|
|
||||||
|
var = conf->getValue ("server_opts");
|
||||||
|
if (var != "") {
|
||||||
|
tentacle_cmd += " " + var;
|
||||||
|
}
|
||||||
|
|
||||||
|
tentacle_cmd += " " + filepath;
|
||||||
|
|
||||||
|
/* Copy the file */
|
||||||
|
pandoraDebug ("Remote copying XML %s on server %s",
|
||||||
|
filepath.c_str (), host.c_str ());
|
||||||
|
pandoraDebug ("Command %s", tentacle_cmd.c_str());
|
||||||
|
|
||||||
|
rc = system (tentacle_cmd.c_str());
|
||||||
|
switch (rc) {
|
||||||
|
|
||||||
|
/* system() error */
|
||||||
|
case -1:
|
||||||
|
pandoraLog ("Unable to copy %s", filename.c_str ());
|
||||||
|
throw Pandora_Exception ();
|
||||||
|
|
||||||
|
/* tentacle_client.exe returned OK */
|
||||||
|
case 0:
|
||||||
|
break;
|
||||||
|
|
||||||
|
/* tentacle_client.exe error */
|
||||||
|
default:
|
||||||
|
pandoraLog ("Tentacle client was unable to copy %s",
|
||||||
|
filename.c_str ());
|
||||||
|
throw Pandora_Exception ();
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Pandora_Windows_Service::copyScpDataFile (string host,
|
Pandora_Windows_Service::copyScpDataFile (string host,
|
||||||
string remote_path,
|
string remote_path,
|
||||||
|
@ -274,6 +342,8 @@ Pandora_Windows_Service::copyDataFile (string filename)
|
||||||
try {
|
try {
|
||||||
if (mode == "ftp") {
|
if (mode == "ftp") {
|
||||||
copyFtpDataFile (host, remote_path, filename);
|
copyFtpDataFile (host, remote_path, filename);
|
||||||
|
} else if (mode == "tentacle") {
|
||||||
|
copyTentacleDataFile (host, filename);
|
||||||
} else if (mode == "ssh" || mode == "") {
|
} else if (mode == "ssh" || mode == "") {
|
||||||
copyScpDataFile (host, remote_path, filename);
|
copyScpDataFile (host, remote_path, filename);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -43,6 +43,8 @@ namespace Pandora {
|
||||||
|
|
||||||
TiXmlElement *getXmlHeader ();
|
TiXmlElement *getXmlHeader ();
|
||||||
void copyDataFile (string filename);
|
void copyDataFile (string filename);
|
||||||
|
void copyTentacleDataFile (string host,
|
||||||
|
string filename);
|
||||||
void copyScpDataFile (string host,
|
void copyScpDataFile (string host,
|
||||||
string remote_path,
|
string remote_path,
|
||||||
string filename);
|
string filename);
|
||||||
|
|
Loading…
Reference in New Issue