Commit 5049a66c authored by Nikola Hardi's avatar Nikola Hardi Committed by Nikola Hardi
Browse files

Fix reading username when connected to JCentral

parent 166dba77
......@@ -34,7 +34,6 @@ TJAlien::TJAlien (const char* gridUrl, const char* uId, const char* passwd,
{
if (gDebug > 1) Info("TJAlien", "Connecting to JBox");
UNUSED(gridUrl);
UNUSED(uId);
UNUSED(passwd);
UNUSED(options);
......@@ -59,6 +58,22 @@ TJAlien::TJAlien (const char* gridUrl, const char* uId, const char* passwd,
else
tmpdir = getenv("TMPDIR");
if (!uId[0]) {
if (gSystem->Getenv("alien_API_USER")) {
fUser = gSystem->Getenv("alien_API_USER");
} else {
if (gSystem->Getenv("LOGNAME")) {
// we try the LOGNAME env
fUser = gSystem->Getenv("LOGNAME");
} else {
// we set the USER env
fUser = gSystem->Getenv("USER");
}
}
} else {
fUser = uId;
}
std::string tokencert = tmpdir + "/tokencert.pem";
std::string tokenkey = tmpdir + "/tokenkey.pem";
std::string tokencertpath = std::getenv("JALIEN_TOKEN_CERT") ? : tokencert;
......@@ -127,7 +142,6 @@ void TJAlien::ConnectJBox(std::string certpath, std::string keypath)
fHost = default_server;
fPort = 8098;
fWSPort = 8097;
fUser = "";
fPw = "";
MakeWebsocketConnection(certpath, keypath);
}
......
Supports Markdown
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