Skip to content
Snippets Groups Projects
Commit 048318e1 authored by Ruud Overeem's avatar Ruud Overeem
Browse files

BugID: 811

When a task cannot find the parsetfile argv[0].parset during the init-phase
the task no longer aborts, it just gives a debug-message in the logfile.
This is neccesary for the controlleris since the controllers need an observai-
tion-related (and instance-related) parsetfile that has the treeID and the
instanceNr mangled in its name. The controllers theirselves know which
parset file to open and do this in the constructor, so the task will still
abort if the right parset file can not be found.
parent af36eb06
No related branches found
No related tags found
No related merge requests found
......@@ -9,6 +9,9 @@ namespace LOFAR {
namespace GCF {
namespace Common {
// Returns the full or short version of the hostname
string myHostname(bool giveFullName);
void convListToString(std::string& listString,
const std::list<std::string>& stringList);
void convStringToList(std::list<std::string>& stringList,
......
......@@ -7,13 +7,29 @@
using std::set;
namespace LOFAR
namespace LOFAR {
namespace GCF {
namespace Common {
//
// myHostname(giveFullname)
//
string myHostname(bool giveFullName)
{
namespace GCF
{
namespace Common
{
char fullhostname[300];
if (gethostname(fullhostname, 300) != 0) {
return ("localhost");
}
if (!giveFullName) {
char* dot = strchr(fullhostname, '.');
if (dot) {
*dot='\0';
}
}
return (fullhostname);
}
void convListToString(string& listString,
const list<string>& stringList)
......
......@@ -89,8 +89,13 @@ void GCFTask::init(int argc, char** argv)
// Read in the ParameterSet of the task (<task>.conf)
ParameterSet* pParamSet = ACC::APS::globalParameterSet();
string configFile(aCL.locate(procName + ".conf"));
LOG_DEBUG_STR ("Using parameterfile: " << configFile);
pParamSet->adoptFile(configFile);
if (!configFile.empty()) {
LOG_DEBUG_STR ("Using parameterfile: " << configFile);
pParamSet->adoptFile(configFile);
}
else {
LOG_DEBUG_STR ("NO DEFAULT PARAMETERSET FOUND");
}
if (_doExit) {
exit(-1);
......
......@@ -183,7 +183,7 @@ GCFEvent::TResult GSBController::operational(GCFEvent& event, GCFPortInterface&
LOG_INFO(formatString ("Serviceinfo for %s is %d",
request.servicename.c_str(), portNr));
response.portnumber = portNr;
response.hostname = Common::myHostname();
response.hostname = Common::myHostname(true);
response.result = SB_NO_ERROR;
}
else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment