Skip to content
GitLab
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-devel
Commits
7a528e68
Commit
7a528e68
authored
Sep 23, 2011
by
Kevin Atkinson
Browse files
Check that node_history_id is defined before logging to the
image_history table. Output a warning if its not, and skip that node.
parent
8b9e4dee
Changes
1
Hide whitespace changes
Inline
Side-by-side
tbsetup/os_setup_new.in
View file @
7a528e68
...
...
@@ -659,6 +659,11 @@ if ($exit_code == 0) {
my
(
$node_history_id
)
=
DBQuerySingleFatal
("
select max(history_id)
"
.
"
from node_history where node_id = '
$node_id
'
");
if
(
!
defined
$node_history_id
)
{
tbwarn
("
No node_history for
$node_id
, can't log image usage for node.
");
next
;
}
my
(
$erole
,
$osname
,
$req_type
,
$phys_type
)
=
DBQuerySingleFatal
("
select r.erole, v.osname, v.type, n.type
"
.
"
from reserved as r
"
.
...
...
@@ -668,7 +673,7 @@ if ($exit_code == 0) {
my
$req_os
=
defined
$osname
?
(
$osname
?
1
:
0
)
:
'
NULL
';
$erole
=
'
delay
'
if
$erole
eq
'
delaynode
';
$req_type
=
$erole
unless
defined
$req_type
;
DBQueryFatal
("
insert into image_history
"
.
"
(stamp, node_history_id, node_id,
"
.
"
action, newly_alloc, rsrcidx, log_session,
"
.
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment