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-devel
Commits
89971250
Commit
89971250
authored
Dec 06, 2012
by
Jonathon Duerig
Browse files
Various bugfixes.
parent
c9c70961
Changes
3
Hide whitespace changes
Inline
Side-by-side
backend/GNUmakefile.in
View file @
89971250
...
...
@@ -31,7 +31,7 @@ include $(OBJDIR)/Makeconf
BIN_SCRIPTS = newosid moduserinfo newgroup newmmlist editexp editimageid \
editnodetype editsitevars newimageid editgroup \
newimageid_ez joinproject
newimageid_ez joinproject
newscript
WEB_BIN_SCRIPTS = webnewosid webmoduserinfo webnewgroup webnewmmlist \
webeditexp webeditimageid webeditnodetype webeditsitevars \
webnewimageid webeditgroup webnewimageid_ez
...
...
backend/newscript.in
View file @
89971250
...
...
@@ -76,7 +76,7 @@ use OSinfo;
sub
fatal
($);
sub
UserError
(
;
$
);
sub
PrintResult
($);
sub
ModifyRow
($);
sub
ModifyRow
($
$
);
sub
RemoveRow
($);
sub
ResolveRow
($);
sub
CommitNode
($);
...
...
@@ -385,9 +385,9 @@ exit(0)
my
$rowlist
;
if
(
$args
{"
command
"}
eq
"
add
")
{
ModifyRow
(
undef
);
ModifyRow
(
$id
,
0
);
}
elsif
(
$args
{"
command
"}
eq
"
update
")
{
ModifyRow
(
$id
);
ModifyRow
(
$id
,
1
);
}
elsif
(
$args
{"
command
"}
eq
"
rollback
")
{
RemoveRow
(
$id
);
}
elsif
(
$args
{"
command
"}
eq
"
commit
")
{
...
...
@@ -448,12 +448,12 @@ sub PrintResult($)
}
}
sub
ModifyRow
($)
sub
ModifyRow
($
$
)
{
my
(
$id
)
=
@_
;
my
(
$id
,
$isupdate
)
=
@_
;
my
$query
;
my
$none_changed
=
1
;
if
(
defined
(
$id
)
)
{
if
(
$isupdate
)
{
$query
=
"
UPDATE
";
}
else
{
$query
=
"
INSERT
";
...
...
@@ -461,7 +461,8 @@ sub ModifyRow($)
$query
.=
"
$tabledb
SET
";
foreach
$key
(
keys
(
%args
))
{
my
$value
=
$args
{
$key
};
if
(
$key
ne
"
table
"
&&
$key
ne
"
command
"
&&
$key
ne
$tableid
if
(
$key
ne
"
table
"
&&
$key
ne
"
command
"
&&
(
!
$isupdate
||
$key
ne
$tableid
)
&&
defined
(
$value
))
{
if
(
$query
ne
"
UPDATE
$tabledb
SET
"
&&
$query
ne
"
INSERT
$tabledb
SET
")
{
...
...
@@ -471,7 +472,7 @@ sub ModifyRow($)
$none_changed
=
0
;
}
}
if
(
defined
(
$id
)
)
{
if
(
$isupdate
)
{
$query
.=
"
WHERE
$tableid
='
$id
'
";
}
if
(
$none_changed
==
1
)
{
...
...
install/genirack/mknewconfig.pl
100644 → 100755
View file @
89971250
#!/usr/bin/perl
use
XML::
LibXML
;
use
XML::LibXML::
XPathContext
;
use
XML::LibXML::
NodeList
;
...
...
@@ -24,6 +26,7 @@ my @iplist = <IP>;
my
%control_ips
=
{};
my
%ilo_ips
=
{};
foreach
my
$line
(
@iplist
)
{
chomp
(
$line
);
my
@fields
=
split
(
/ /
,
$line
);
my
$node_id
=
$fields
[
0
];
my
$control
=
$fields
[
1
];
...
...
@@ -101,10 +104,18 @@ foreach my $current (values(%devices)) {
}
print
NODE_FILE
"
<attribute name='node_id'><value>
$node_id
</value></attribute>
\n
";
print
NODE_FILE
"
<attribute name='type'><value>dl360</value></attribute>
\n
";
print
NODE_FILE
"
<attribute name='
ip
'><value>
$ip
</value></attribute>
\n
";
print
NODE_FILE
"
<attribute name='
IP
'><value>
$ip
</value></attribute>
\n
";
print
NODE_FILE
"
<attribute name='identifier'><value>
$node_id
</value></attribute>
\n
";
print
NODE_FILE
"
</newnode>
\n
";
close
(
NODE_FILE
);
open
(
NODE_FILE
,
"
>
$outpath
/node.
$node_id
.commit
");
print
NODE_FILE
"
<newnode>
\n
";
print
NODE_FILE
"
<attribute name='table'><value>node</value></attribute>
\n
";
print
NODE_FILE
"
<attribute name='command'><value>commit</value></attribute>
\n
";
print
NODE_FILE
"
<attribute name='id'><value>
$id
</value></attribute>
\n
";
print
NODE_FILE
"
</newnode>
\n
";
close
(
NODE_FILE
);
}
# Print interfaces
...
...
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