Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emulab
emulab-devel
Commits
8fcc3eea
Commit
8fcc3eea
authored
Feb 11, 2010
by
Jonathon Duerig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a new function to allow removal of XML nodes by name. Fixed a related bug in the CM.
parent
a30ffc59
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
protogeni/lib/GeniCM.pm.in
protogeni/lib/GeniCM.pm.in
+2
-2
protogeni/lib/GeniXML.pm.in
protogeni/lib/GeniXML.pm.in
+12
-0
No files found.
protogeni/lib/GeniCM.pm.in
View file @
8fcc3eea
...
...
@@ -4010,11 +4010,11 @@ sub UpdateManifest($)
}
$vlantags{$vlan->vname()} = $tag;
}
foreach my $linkref (GeniXML::GetNodes("n:link", $rspec)) {
foreach my $linkref (GeniXML::GetNodes("n:link", $rspec)
->get_nodelist()
) {
my $vname = GeniXML::GetVirtualId($linkref);
my $tag = (exists($vlantags{$vname}) ? $vlantags{$vname} : undef);
if (!defined($tag)) {
$linkref->r
emoveChild("vlantag");
GeniXML::R
emoveChild("vlantag"
, $linkref
);
}
else {
GeniXML::SetText("vlantag", $linkref, $tag);
...
...
protogeni/lib/GeniXML.pm.in
View file @
8fcc3eea
...
...
@@ -261,5 +261,17 @@ sub AddElement($$)
return $child;
}
sub RemoveChild($$)
{
my ($name, $node) = @_;
my $child = FindFirst('
@
n
:
'.$name, $node);
if (! defined($child)) {
$child = FindFirst('
n
:
'.$name, $node);
}
if (defined($child)) {
$node->removeChild($child);
}
}
# _Always_ make sure that this 1 is at the end of the file...
1;
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