Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
emulab-devel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
emulab
emulab-devel
Commits
3f2d40c7
Commit
3f2d40c7
authored
18 years ago
by
Leigh B. Stoller
Browse files
Options
Downloads
Patches
Plain Diff
As per Jay's request, send a join request to new leader for old
leader, when changing the leader of a project when its created.
parent
a10e8b3d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tbsetup/mkproj.in
+34
-7
34 additions, 7 deletions
tbsetup/mkproj.in
with
34 additions
and
7 deletions
tbsetup/mkproj.in
+
34
−
7
View file @
3f2d40c7
...
@@ -26,7 +26,7 @@ sub usage()
...
@@ -26,7 +26,7 @@ sub usage()
my
$optlist
=
"
qsh:m:f:
";
my
$optlist
=
"
qsh:m:f:
";
my
$quiet
=
0
;
my
$quiet
=
0
;
my
$silent
=
0
;
my
$silent
=
0
;
my
$leader_uid
;
my
$
new
leader_uid
;
my
$message
;
my
$message
;
my
$mfilename
;
my
$mfilename
;
my
$pid
;
my
$pid
;
...
@@ -40,7 +40,9 @@ sub fatal($);
...
@@ -40,7 +40,9 @@ sub fatal($);
my
$TB
=
"
@prefix
@
";
my
$TB
=
"
@prefix
@
";
my
$TBOPS
=
"
@TBOPSEMAIL
@
";
my
$TBOPS
=
"
@TBOPSEMAIL
@
";
my
$TBAPPROVAL
=
"
@TBAPPROVALEMAIL
@
";
my
$TBAPPROVAL
=
"
@TBAPPROVALEMAIL
@
";
my
$TBAUDIT
=
"
@TBAUDITEMAIL
@
";
my
$TBBASE
=
"
@TBBASE
@
";
my
$TBBASE
=
"
@TBBASE
@
";
my
$TBWWW
=
"
@TBWWW
@
";
my
$MKGROUP
=
"
$TB
/sbin/mkgroup
";
my
$MKGROUP
=
"
$TB
/sbin/mkgroup
";
my
$MODGROUPS
=
"
$TB
/sbin/modgroups
";
my
$MODGROUPS
=
"
$TB
/sbin/modgroups
";
my
$MKACCT
=
"
$TB
/sbin/tbacct add
";
my
$MKACCT
=
"
$TB
/sbin/tbacct add
";
...
@@ -93,7 +95,7 @@ my $CVSREPOS = "$PROJROOT/cvsrepos";
...
@@ -93,7 +95,7 @@ my $CVSREPOS = "$PROJROOT/cvsrepos";
# Locals
# Locals
my
$leader
;
my
$leader
;
my
$
projh
ead
;
my
$
oldl
ead
er
;
#
#
# We do not want to run this script unless its the real version.
# We do not want to run this script unless its the real version.
...
@@ -134,7 +136,7 @@ if (defined($options{"f"})) {
...
@@ -134,7 +136,7 @@ if (defined($options{"f"})) {
if
(
!
-
e
$mfilename
);
if
(
!
-
e
$mfilename
);
}
}
if
(
defined
(
$options
{"
h
"}))
{
if
(
defined
(
$options
{"
h
"}))
{
$leader_uid
=
$options
{"
h
"};
$
new
leader_uid
=
$options
{"
h
"};
}
}
usage
()
usage
()
if
(
!
@ARGV
);
if
(
!
@ARGV
);
...
@@ -201,10 +203,10 @@ if (defined($mfilename)) {
...
@@ -201,10 +203,10 @@ if (defined($mfilename)) {
# leader. Note that this is allowed *only* for projects that have not
# leader. Note that this is allowed *only* for projects that have not
# been approved yet.
# been approved yet.
#
#
if
(
defined
(
$leader_uid
))
{
if
(
defined
(
$
new
leader_uid
))
{
$leader
=
User
->
Lookup
(
$leader_uid
);
$leader
=
User
->
Lookup
(
$
new
leader_uid
);
if
(
!
defined
(
$leader
))
{
if
(
!
defined
(
$leader
))
{
fatal
("
Could not map user
$leader_uid
to its object!
");
fatal
("
Could not map user
$
new
leader_uid
to its object!
");
}
}
# See if already did this; is so skip the following checks.
# See if already did this; is so skip the following checks.
my
$curleader
=
$target_project
->
GetLeader
();
my
$curleader
=
$target_project
->
GetLeader
();
...
@@ -215,11 +217,14 @@ if (defined($leader_uid)) {
...
@@ -215,11 +217,14 @@ if (defined($leader_uid)) {
fatal
("
Not allowed to change the leader of an approved project!
")
fatal
("
Not allowed to change the leader of an approved project!
")
if
(
$target_project
->
approved
());
if
(
$target_project
->
approved
());
# Save for email below.
$oldleader
=
$curleader
;
# Update the project structure with the new leader. We are going
# Update the project structure with the new leader. We are going
# to set the approved bit below, so this is the last chance to do
# to set the approved bit below, so this is the last chance to do
# this until we have code in place to change it later.
# this until we have code in place to change it later.
$target_project
->
ChangeLeader
(
$leader
)
==
0
or
$target_project
->
ChangeLeader
(
$leader
)
==
0
or
fatal
("
Could not change
project
leader for
$pid
to
$leader_uid
!
");
fatal
("
Could not change leader for
$pid
to
$
new
leader_uid
!
");
}
}
}
}
else
{
else
{
...
@@ -481,6 +486,28 @@ if (!$silent) {
...
@@ -481,6 +486,28 @@ if (!$silent) {
"
Testbed Operations
\n
",
"
Testbed Operations
\n
",
"
$TBAPPROVAL
",
"
$TBAPPROVAL
",
"
Bcc:
$TBAPPROVAL
");
"
Bcc:
$TBAPPROVAL
");
#
# If the leader was switched, then generate a second message to the
# new leader telling him to approve the original leader to the project.
#
if
(
defined
(
$oldleader
))
{
my
$oldleader_uid
=
$oldleader
->
uid
();
my
$oldleader_name
=
$oldleader
->
name
();
SENDMAIL
("
$leader_name
<
$leader_email
>
",
"
$oldleader_uid
$pid
Project Join Request
",
"
$oldleader_name
wants to join project
$pid
.
\n
"
.
"
\n
"
.
"
Please return to
$TBWWW
,
\n
"
.
"
log in, select the 'New User Approval' page, and enter
\n
"
.
"
your decision regarding
${oldleader_name}
's membership.
\n
"
.
"
\n
"
.
"
Thanks,
\n
"
.
"
Testbed Operations
\n
",
"
$TBAPPROVAL
",
"
Bcc:
$TBAUDIT
");
}
}
}
print
"
Project Creation Completed!
\n
";
print
"
Project Creation Completed!
\n
";
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment