Commit 4ef30426 authored by Jonathon Duerig's avatar Jonathon Duerig
Browse files

BUGFIX: IsLocalNode now properly detects locality. IsLanNode has also been fixed.

parent dab52336
......@@ -11,7 +11,7 @@ use Exporter;
use vars qw(@ISA @EXPORT);
@ISA = "Exporter";
@EXPORT = qw(Parse ParseFile FindNodes FindFirst FindElement FindAttr IsLanNode IsLocalNode GetNodeId GetVirtualId GetManagerId SetText GetText);
@EXPORT = qw(Parse ParseFile FindNodes FindFirst FindElement FindAttr IsLanNode IsLocalNode GetNodeId GetVirtualId GetManagerId SetText GetText CreateDocument AddElement);
use English;
use XML::LibXML;
......@@ -128,9 +128,9 @@ sub IsLanNode($)
my ($node) = @_;
my $result = 0;
if (defined($node) && $node->localname() eq "node") {
foreach my $lan (FindNodes("./n:node_type/n:type_name",
$node)->get_nodelist()) {
if ($lan->textContent() eq "lan") {
foreach my $lan (FindNodes("n:node_type", $node)->get_nodelist()) {
my $typeName = GetText("type_name", $lan);
if (defined($typeName) && $typeName eq "lan") {
$result = 1;
last;
}
......@@ -147,9 +147,7 @@ sub IsLocalNode($)
my ($node) = @_;
my $result = 0;
if (defined($node) && $node->localname() eq "node") {
my $manager_uuid = FindFirst("./n:component_manager_uuid | ".
"./n:component_manager_urn",
$node);
my $manager_uuid = GetManagerId($node);
if (! defined($manager_uuid) ||
GeniHRN::Equal($manager_uuid, $ENV{'MYURN'}) ||
$manager_uuid eq $ENV{'MYUUID'}) {
......@@ -241,5 +239,16 @@ sub GetText($$)
return $result;
}
sub CreateDocument($$)
{
my ($ns, $name) = @_;
my $doc = XML::LibXML::Document->createDocument("1.0", "UTF-8");
}
sub AddElement($$)
{
my ($name, $node) = @_;
}
# _Always_ make sure that this 1 is at the end of the file...
1;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment