Commit 9eb3d83c authored by Volodymyr Yurchenko's avatar Volodymyr Yurchenko
Browse files

Implement getSite command

parent 30a2e6fe
......@@ -110,6 +110,9 @@ public:
void Stderr(); // print the stderr of the last executed command
void Token(Option_t* options = "", bool force_restart = true);
TGridResult* SetSite(const char *site = "CERN");
const char* Whoami();
//--- Redefinition of superclass methods
virtual Bool_t IsConnected() const { return connection.IsConnected(); }
......@@ -118,7 +121,6 @@ public:
virtual Bool_t Cd(const char* ldn = "",Bool_t verbose = kFALSE);
virtual const char *Pwd(Bool_t verbose = kFALSE);
virtual const char *GetHomeDirectory();
const char* Whoami();
virtual Int_t Mkdir(const char* ldn = "", Option_t* options = "", Bool_t verbose = kFALSE);
virtual Bool_t Rmdir(const char* ldn = "", Option_t* options = "", Bool_t verbose = kFALSE);
virtual Bool_t Register(const char *lfn, const char *turl, Long_t size=-1, const char *se=0, const char *guid=0, Bool_t verbose=kFALSE);
......
......@@ -58,7 +58,7 @@ void TJAlien::Connect()
}
// Run a command to initialize gGrid variables from the metadata
Cd("");
SetSite(gSystem->Getenv("ALIEN_SITE"));
fHome = fPwd;
// Change to the last known location
......@@ -1154,6 +1154,17 @@ const char* TJAlien::Whoami()
return fUser.Data();
};
//______________________________________________________________________________
TGridResult* TJAlien::SetSite(const char *site)
{
TString cmdline = TString("setSite");
if (site == nullptr || std::string(site).find_first_not_of(' ') == std::string::npos)
site = "CERN";
cmdline += TString(" ") + site;
return Command(cmdline);
}
//______________________________________________________________________________
void TJAlien::NotImplemented(const char *func, const char *file, int line)
{
......
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