|
From: <buc...@us...> - 2012-12-27 18:01:19
|
Revision: 239
http://devmon.svn.sourceforge.net/devmon/?rev=239&view=rev
Author: buchanmilne
Date: 2012-12-27 18:01:12 +0000 (Thu, 27 Dec 2012)
Log Message:
-----------
Overloading of the trans_data element of a SWITCH or TSWITCH transform
was preventing transform ordering according to dependencies from working.
Use a new element (trans_edata) to hold the SWITCH-specific template data instead.
Modified Paths:
--------------
trunk/modules/dm_templates.pm
trunk/modules/dm_tests.pm
Modified: trunk/modules/dm_templates.pm
===================================================================
--- trunk/modules/dm_templates.pm 2012-12-21 08:55:17 UTC (rev 238)
+++ trunk/modules/dm_templates.pm 2012-12-27 18:01:12 UTC (rev 239)
@@ -261,8 +261,8 @@
$oid_h->{'trans_data'} =~ /\{(.+?)}\s*(.+)/;
next if !defined $dep_oid;
- $oid_h->{'trans_data'} = {};
- my $trans_data = \%{$oid_h->{'trans_data'}};
+ $oid_h->{'trans_edata'} = {};
+ my $trans_data = \%{$oid_h->{'trans_edata'}};
my $cases = \%{$trans_data->{'cases'}};
my $case_num = 0;
my $default;
Modified: trunk/modules/dm_tests.pm
===================================================================
--- trunk/modules/dm_tests.pm 2012-12-21 08:55:17 UTC (rev 238)
+++ trunk/modules/dm_tests.pm 2012-12-27 18:01:12 UTC (rev 239)
@@ -102,8 +102,8 @@
next if !$oids->{$oid}{'transform'} or
defined $oids->{$oid}{'val'};
# Only transform if we have dependent value, otherwise push onto end of queue (not a perfect solution, but better than before)
- if(ref $oids->{$oid}{trans_data} eq "HASH" && ! defined $oids->{$oids->{$oid}{trans_data}{dep_oid}}{val}) {
- do_log("Skipping oid $oid until ".$oids->{$oid}{trans_data}{dep_oid}." defined for $device") if $g{debug};
+ if(ref $oids->{$oid}{trans_edata} eq "HASH" && ! defined $oids->{$oids->{$oid}{trans_edata}{dep_oid}}{val}) {
+ do_log("Skipping oid $oid until ".$oids->{$oid}{trans_edata}{dep_oid}." defined for $device") if $g{debug};
push @translist,($oid) unless $skiplist{$oid}++;
} else {
transform($device, $oids, $oid, $thr);
@@ -168,6 +168,7 @@
$oids->{$oid}{'transform'} = 1;
$oids->{$oid}{'trans_type'} = $tmpl->{'oids'}{$oid}{'trans_type'};
$oids->{$oid}{'trans_data'} = $tmpl->{'oids'}{$oid}{'trans_data'};
+ $oids->{$oid}{'trans_edata'} = $tmpl->{'oids'}{$oid}{'trans_edata'};
next;
}
@@ -1185,7 +1186,8 @@
my ($device, $oids, $oid, $thr) = @_;
my $oid_h = \%{$oids->{$oid}};
- my $trans_data = \%{$oid_h->{'trans_data'}};
+ my $trans_data = \%{$oid_h->{'trans_edata'}};
+ #my $trans_odata = \%{$oid_h->{'trans_data'}};
my $dep_oid = $trans_data->{'dep_oid'};
my $dep_oid_h = \%{$oids->{$dep_oid}};
my $cases = \%{$trans_data->{'cases'}};
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|