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
d89c8762
Commit
d89c8762
authored
Nov 07, 2011
by
Leigh B Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add impotent (-n) and silent (-s) options (for portal).
parent
f0436fd6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
4 deletions
+18
-4
account/newproj.in
account/newproj.in
+18
-4
No files found.
account/newproj.in
View file @
d89c8762
...
...
@@ -19,9 +19,11 @@ sub usage()
print
("
newproj -l -m <pid_idx>
\n
");
exit
(
-
1
);
}
my
$optlist
=
"
dm:l
";
my
$optlist
=
"
dm:l
ns
";
my
$debug
=
0
;
my
$nonlocal
=
0
;
my
$impotent
=
0
;
my
$silent
=
0
;
my
$resend
;
#
...
...
@@ -81,6 +83,12 @@ if (! getopts($optlist, \%options)) {
if
(
defined
(
$options
{"
d
"}))
{
$debug
=
1
;
}
if
(
defined
(
$options
{"
n
"}))
{
$impotent
=
1
;
}
if
(
defined
(
$options
{"
s
"}))
{
$silent
=
1
;
}
if
(
defined
(
$options
{"
l
"}))
{
$nonlocal
=
1
;
}
...
...
@@ -293,8 +301,11 @@ if (exists($newproj_args{'newuser_xml'})) {
# determines which args are required or optional in the xml data! The
# user type is always "project leader" for new users under newproj.
#
my
$opt
=
(
$nonlocal
?
"
-t nonlocal
"
:
"");
my
$cmd
=
"
newuser -t leader
$newuser_xml
";
my
$opt
=
(
$impotent
?
"
-n
"
:
"");
$opt
.=
"
-d
"
if
(
$debug
);
my
$cmd
=
"
newuser
$opt
-t leader
$newuser_xml
";
print
$cmd
.
"
\n
"
if
(
$debug
);
my
$cmd_out
=
`
$cmd
`;
...
...
@@ -320,6 +331,9 @@ UserError("Project already exists; pick another name!")
my
$leader
=
User
->
Lookup
(
$newproj_args
{'
head_uid
'});
UserError
("
Project leader does not exist!
")
if
(
!
defined
(
$leader
));
exit
(
0
)
if
(
$impotent
);
#
# Now safe to create the project. Move the pid out of the argument array
...
...
@@ -346,7 +360,7 @@ TBGetSiteVar("general/firstinit/state", \$firstinitstate);
# Send the email notification.
#
$newproj
->
SendNewProjectEmail
(
$firstinitstate
eq
"
createproject
")
if
(
!
$nonlocal
);
if
(
!
(
$nonlocal
||
$silent
)
);
# Unlink this here, so that the newuser file is left behind in case of error.
# We can then create the user by hand from the xmlfile, if desired.
...
...
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