Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-stable
Commits
ed783338
Commit
ed783338
authored
Sep 20, 2007
by
Russ Fish
Browse files
Tweak the newosid "template".
parent
8965aad8
Changes
4
Hide whitespace changes
Inline
Side-by-side
backend/newosid.in
View file @
ed783338
...
...
@@ -110,12 +110,11 @@ else {
fatal
("
Bad data in translated pathname:
$xmlfile
");
}
# The web interface (and in the future the xmlrpc interface) will
# sets this.
# The web interface (and in the future the xmlrpc interface) sets this.
$this_user
=
User
->
ImpliedUser
();
if
(
!
defined
(
$this_user
))
{
fatal
("
Cannot determin
d
implied user!
");
fatal
("
Cannot determin
e
implied user!
");
}
}
...
...
@@ -280,10 +279,14 @@ delete($newosid_args{"osname"});
# Ditto the pid.
delete
(
$newosid_args
{"
pid
"});
my
$new_osinfo
=
OSinfo
->
Create
(
$project
,
$this_user
,
$osname
,
\
%newosid_args
);
if
(
!
defined
(
$new_osinfo
))
{
fatal
("
Could not create new OSID!
");
}
my
$usrerr
;
my
$new_osinfo
=
OSinfo
->
Create
(
$project
,
$this_user
,
$osname
,
\
%newosid_args
,
\
$usrerr
);
UserError
(
$usrerr
)
if
(
defined
(
$usrerr
));
fatal
("
Could not create new OSID!
")
if
(
!
defined
(
$new_osinfo
));
my
$osid
=
$new_osinfo
->
osid
();
# The web interface requires this line to be printed.
...
...
db/OSinfo.pm.in
View file @
ed783338
...
...
@@ -174,12 +174,12 @@ sub mfs($) { return field($_[0], "mfs"); }
sub
reboot_waittime
($)
{
return
field
($
_
[
0
],
"reboot_waittime"
);
}
#
#
Create
a
new
experiment
.
This
installs
the
new
record
in
the
DB
,
#
Create
a
new
os_info
.
This
installs
the
new
record
in
the
DB
,
#
and
returns
an
instance
.
There
is
some
bookkeeping
along
the
way
.
#
sub
Create
($$$$)
{
my
($
class
,
$
project
,
$
creator
,
$
osname
,
$
argref
)
=
@
_
;
my
($
class
,
$
project
,
$
creator
,
$
osname
,
$
argref
,
$
usrerr_ref
)
=
@
_
;
my
$
idx
;
my
$
now
=
time
();
...
...
@@ -203,7 +203,7 @@ sub Create($$$$)
if
($
query_result
->
numrows
)
{
DBQueryWarn
(
"unlock tables"
);
tberror
(
"
OS $osname in project $pid already exists!"
)
;
$$
usrerr_ref
=
"Error:
OS $osname in project $pid already exists!"
;
return
undef
;
}
...
...
utils/newosid.in
View file @
ed783338
...
...
@@ -110,12 +110,11 @@ else {
fatal
("
Bad data in translated pathname:
$xmlfile
");
}
# The web interface (and in the future the xmlrpc interface) will
# sets this.
# The web interface (and in the future the xmlrpc interface) sets this.
$this_user
=
User
->
ImpliedUser
();
if
(
!
defined
(
$this_user
))
{
fatal
("
Cannot determin
d
implied user!
");
fatal
("
Cannot determin
e
implied user!
");
}
}
...
...
@@ -280,10 +279,14 @@ delete($newosid_args{"osname"});
# Ditto the pid.
delete
(
$newosid_args
{"
pid
"});
my
$new_osinfo
=
OSinfo
->
Create
(
$project
,
$this_user
,
$osname
,
\
%newosid_args
);
if
(
!
defined
(
$new_osinfo
))
{
fatal
("
Could not create new OSID!
");
}
my
$usrerr
;
my
$new_osinfo
=
OSinfo
->
Create
(
$project
,
$this_user
,
$osname
,
\
%newosid_args
,
\
$usrerr
);
UserError
(
$usrerr
)
if
(
defined
(
$usrerr
));
fatal
("
Could not create new OSID!
")
if
(
!
defined
(
$new_osinfo
));
my
$osid
=
$new_osinfo
->
osid
();
# The web interface requires this line to be printed.
...
...
www/newosid.php3
View file @
ed783338
...
...
@@ -83,8 +83,7 @@ function SPITFORM($formfields, $errors)
#
echo
"<tr>
<td>*Select Project:</td>
<td><select name=
\"
formfields[pid]
\"
onChange='SetPrefix(idform);'>
<td><select name=
\"
formfields[pid]
\"
>
<option value=''>Please Select  </option>
\n
"
;
while
(
list
(
$project
)
=
each
(
$projlist
))
{
...
...
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