Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
JAliEn
JAliEn-ROOT
Commits
b3b73956
Commit
b3b73956
authored
Nov 12, 2018
by
Nikola Hardi
Committed by
Nikola Hardi
Mar 18, 2019
Browse files
Improvements related to TJAlien::GetUser()
parent
5049a66c
Changes
2
Hide whitespace changes
Inline
Side-by-side
TJAlien.cxx
View file @
b3b73956
...
...
@@ -248,6 +248,8 @@ void TJAlien::MakeWebsocketConnection(std::string certpath, std::string keypath)
}
}
fUser
=
Whoami
();
return
;
}
...
...
@@ -649,6 +651,9 @@ TGridResult *TJAlien::Command(const char *command, bool interactive, UInt_t stre
delete
tokens
;
delete
sCmd
;
TObjString
p
(
"user"
);
fUser
=
result
->
GetMetaData
(
&
p
)
->
GetString
().
Data
();
return
result
;
}
...
...
@@ -1728,6 +1733,18 @@ int TJAlien::ws_service_callback(struct lws *wsi, enum lws_callback_reasons reas
return
0
;
}
const
char
*
TJAlien
::
Whoami
()
{
TJAlienResult
*
r
=
(
TJAlienResult
*
)
Command
(
"whoami"
);
const
char
*
username
;
if
(
r
&&
(
username
=
r
->
GetKey
(
0
,
"message"
)))
{
return
username
;
}
else
{
Error
(
"TJAlien"
,
"Unable to determine username."
);
return
""
;
}
}
//______________________________________________________________________________
void
TJAlien
::
NotImplemented
(
const
char
*
func
,
const
char
*
file
,
int
line
)
{
...
...
TJAlien.h
View file @
b3b73956
...
...
@@ -131,6 +131,7 @@ private:
static
int
websocket_write_back
(
struct
lws
*
wsi_in
,
const
char
*
str
,
int
str_size_in
);
virtual
TGridResult
*
OpenDataset
(
const
char
*
lfn
,
const
char
*
options
=
""
);
const
char
*
Whoami
();
public:
TJAlien
(
const
char
*
gridUrl
,
const
char
*
uId
=
0
,
const
char
*
passwd
=
0
,
...
...
@@ -140,6 +141,7 @@ public:
TJAlienResult
*
RunJsonCommand
(
TString
*
command
,
TList
*
options
);
TGridResult
*
Command
(
const
char
*
command
,
bool
interactive
=
kFALSE
,
UInt_t
stream
=
kOUTPUT
);
Int_t
GetExitCode
(
TJAlienResult
*
result
,
TObjString
*
&
message
);
unsigned
int
ReadTags
(
int
column
,
std
::
map
<
std
::
string
,
std
::
string
>
&
tags
)
const
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment