Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emulab
emulab-devel
Commits
a027c882
Commit
a027c882
authored
May 31, 2018
by
Leigh B Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small rework of how we map remote pid/uid to local users/projects, it
was not quite right and the graphs were messed up.
parent
5ceb698a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
36 deletions
+45
-36
apt/manage_instance.in
apt/manage_instance.in
+17
-14
apt/manage_reservations.in
apt/manage_reservations.in
+19
-19
protogeni/lib/GeniCluster.pm.in
protogeni/lib/GeniCluster.pm.in
+6
-0
www/aptui/js/resgraphs.js
www/aptui/js/resgraphs.js
+3
-3
No files found.
apt/manage_instance.in
View file @
a027c882
...
...
@@ -2087,22 +2087,25 @@ sub DoMaxExtensionInternal($$)
# Map project/user to local users (if appropriate).
foreach
my
$res
(
values
(
%
{
$reslist
}))
{
if
(
exists
(
$res
->
{'
project
'})
&&
$res
->
{'
project
'}
&&
GeniHRN::
IsValid
(
$res
->
{'
project
'}))
{
my
$project
=
APT_Utility::
MapProjectURN
(
$res
->
{'
project
'});
if
(
defined
(
$project
))
{
$res
->
{'
pid
'}
=
$project
->
pid
();
$res
->
{'
pid_idx
'}
=
$project
->
pid_idx
();
}
my
$project
=
APT_Utility::
MapProjectURN
(
$res
->
{'
project
'});
if
(
defined
(
$project
))
{
$res
->
{'
remote_pid
'}
=
$res
->
{'
pid
'};
$res
->
{'
pid
'}
=
$project
->
pid
();
$res
->
{'
pid_idx
'}
=
$project
->
pid_idx
();
}
if
(
exists
(
$res
->
{'
user
'})
&&
$res
->
{'
user
'}
&&
GeniHRN::
IsValid
(
$res
->
{'
user
'}))
{
my
$geniuser
=
APT_Utility::
MapUserURN
(
$res
->
{'
user
'});
if
(
defined
(
$geniuser
))
{
$res
->
{'
uid
'}
=
$geniuser
->
uid
();
$res
->
{'
uid_idx
'}
=
$geniuser
->
uid_idx
();
}
else
{
$res
->
{'
remote_pid
'}
=
$res
->
{'
pid
'};
}
my
$geniuser
=
APT_Utility::
MapUserURN
(
$res
->
{'
user
'});
if
(
defined
(
$geniuser
))
{
$res
->
{'
remote_uid
'}
=
$res
->
{'
uid
'};
$res
->
{'
uid
'}
=
$geniuser
->
uid
();
$res
->
{'
uid_idx
'}
=
$geniuser
->
uid_idx
();
}
else
{
$res
->
{'
remote_uid
'}
=
$res
->
{'
uid
'};
}
#
# Add these for the web interface since we are already messing
# with the results.
...
...
apt/manage_reservations.in
View file @
a027c882
...
...
@@ -489,25 +489,24 @@ sub DoList()
#
foreach
my
$details
(
values
(
%$list
))
{
my
$userhrn
=
GeniHRN
->
new
(
$details
->
{'
user
'});
my
$geniuser
=
GeniUser
->
Lookup
(
$details
->
{'
user
'},
1
);
if
(
defined
(
$geniuser
)
&&
$geniuser
->
IsLocal
()
)
{
#print Dumper($geniuser)
;
$details
->
{'
uid
'}
=
$geniuser
->
uid
();
$details
->
{'
uid_idx
'}
=
$geniuser
->
idx
();
my
$geniuser
=
MapUserURN
(
$userhrn
);
if
(
defined
(
$geniuser
))
{
$details
->
{'
remote_uid
'}
=
$details
->
{'
uid
'}
;
$details
->
{'
uid
'}
=
$geniuser
->
uid
();
$details
->
{'
uid_idx
'}
=
$geniuser
->
idx
();
}
else
{
$details
->
{'
uid
'}
=
$userhrn
->
id
()
;
$details
->
{'
remote_uid
'}
=
$details
->
{'
uid
'}
;
}
my
$projhrn
=
GeniHRN
->
new
(
$details
->
{'
project
'});
if
(
$projhrn
->
domain
()
eq
$OURDOMAIN
&&
defined
(
$projhrn
->
project
()))
{
my
$project
=
Project
->
Lookup
(
$projhrn
->
project
());
if
(
defined
((
$project
)))
{
$details
->
{'
pid
'}
=
$project
->
pid
();
$details
->
{'
pid_idx
'}
=
$project
->
pid_idx
();
}
my
$project
=
APT_Utility::
MapProjectURN
(
$projhrn
);
if
(
defined
(
$project
))
{
$details
->
{'
remote_pid
'}
=
$details
->
{'
pid
'};
$details
->
{'
pid
'}
=
$project
->
pid
();
$details
->
{'
pid_idx
'}
=
$project
->
pid_idx
();
}
else
{
$details
->
{'
pid
'}
=
$
projhrn
->
id
()
;
$details
->
{'
remote_
pid
'}
=
$
details
->
{'
pid
'}
;
}
#
...
...
@@ -1121,17 +1120,18 @@ sub DoHistory()
my
$userhrn
=
GeniHRN
->
new
(
$res
->
{'
user
'});
if
(
$userhrn
->
domain
()
eq
$OURDOMAIN
&&
$userhrn
->
id
eq
$geniuser
->
uid
())
{
$res
->
{'
uid
'}
=
$geniuser
->
uid
();
$res
->
{'
uid_idx
'}
=
$geniuser
->
idx
();
$res
->
{'
remote_uid
'}
=
$res
->
{'
uid
'};
$res
->
{'
uid
'}
=
$geniuser
->
uid
();
$res
->
{'
uid_idx
'}
=
$geniuser
->
idx
();
}
my
$project
=
APT_Utility::
MapProjectURN
(
$res
->
{'
project
'});
if
(
defined
(
$project
))
{
$res
->
{'
pid
'}
=
$project
->
pid
();
$res
->
{'
pid_idx
'}
=
$project
->
pid_idx
();
$res
->
{'
remote_pid
'}
=
$res
->
{'
pid
'};
$res
->
{'
pid
'}
=
$project
->
pid
();
$res
->
{'
pid_idx
'}
=
$project
->
pid_idx
();
}
else
{
my
$projhrn
=
GeniHRN
->
new
(
$res
->
{'
project
'});
$res
->
{'
pid
'}
=
$projhrn
->
id
();
$res
->
{'
remote_pid
'}
=
$res
->
{'
pid
'};
}
#
...
...
protogeni/lib/GeniCluster.pm.in
View file @
a027c882
...
...
@@ -764,7 +764,9 @@ sub SliceMaxExtension($)
my
$
blob
=
{};
$
blob
->{
"uuid"
}
=
$
res
->
uuid
();
$
blob
->{
"project"
}
=
$
project
->
nonlocalurn
();
$
blob
->{
"pid"
}
=
$
project
->
pid
();
$
blob
->{
"user"
}
=
$
user
->
nonlocalurn
();
$
blob
->{
"uid"
}
=
$
user
->
uid
();
$
blob
->{
"nodes"
}
=
$
res
->
nodes
();
$
blob
->{
"using"
}
=
$
using
;
$
blob
->{
"type"
}
=
$
res
->
type
();
...
...
@@ -1232,7 +1234,9 @@ sub Reservations($)
$
blob
->{
"idx"
}
=
$
idx
;
$
blob
->{
"uuid"
}
=
$
uuid
;
$
blob
->{
"project"
}
=
$
projurn
;
$
blob
->{
"pid"
}
=
$
pid
;
$
blob
->{
"user"
}
=
$
user
->
nonlocalurn
();
$
blob
->{
"uid"
}
=
$
user
->
uid
();
$
blob
->{
"nodes"
}
=
$
row
->{
'nodes'
};
$
blob
->{
"type"
}
=
$
type
;
$
blob
->{
"using"
}
=
$
using
;
...
...
@@ -1709,7 +1713,9 @@ sub ReservationHistory($)
$
blob
->{
"idx"
}
=
""
;
$
blob
->{
"uuid"
}
=
$
res
->
uuid
()
||
""
;
$
blob
->{
"project"
}
=
$
projurn
;
$
blob
->{
"pid"
}
=
$
pid
;
$
blob
->{
"user"
}
=
$
geniuser
->
emulab_user
()->
nonlocalurn
();
$
blob
->{
"uid"
}
=
$
geniuser
->
emulab_user
()->
uid
();
$
blob
->{
"nodes"
}
=
$
res
->
nodes
();
$
blob
->{
"type"
}
=
$
res
->
type
();
$
blob
->{
"created"
}
=
TBDateStringGMT
($
res
->
created
());
...
...
www/aptui/js/resgraphs.js
View file @
a027c882
...
...
@@ -422,11 +422,11 @@ window.DrawResHistoryGraph = (function ()
if
(
Array
.
isArray
(
reserved
))
{
continue
;
}
var
pcount
=
allocated
[
details
.
pid
][
details
.
type
];
var
pcount
=
allocated
[
details
.
remote_
pid
][
details
.
type
];
// Watch for nothing allocated by the user at this time stamp
var
ucount
=
0
;
if
(
_
.
has
(
allocated
,
details
.
uid
))
{
ucount
=
allocated
[
details
.
uid
][
details
.
type
];
if
(
_
.
has
(
allocated
,
details
.
remote_
uid
))
{
ucount
=
allocated
[
details
.
remote_
uid
][
details
.
type
];
}
uvalues
.
push
({
"
x
"
:
stamp
,
"
y
"
:
parseInt
(
ucount
)});
pvalues
.
push
({
"
x
"
:
stamp
,
"
y
"
:
parseInt
(
pcount
)});
...
...
Write
Preview
Markdown
is supported
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