Changeset 2150c6cf464d1a3302d2825109d10e9349082389

Show
Ignore:
Timestamp:
05/09/11 22:25:19 (3 years ago)
Author:
Eric Miller <internetjanitor@gmail.com>
git-committer:
Eric Miller <internetjanitor@gmail.com> 1304979919 -0700
git-parent:

[880c6cef6cac121bb61370f67d47c78025b3b0ef]

git-author:
Eric Miller <internetjanitor@gmail.com> 1304979919 -0700
Message:

Sort xml output by module and service names

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • lib/Resmon/Status.pm

    r61a84e7 r2150c6c  
    7171    my $indent = shift || 0; 
    7272    my $rv = ''; 
    73     while(my ($key, $value) = each %$info) { 
     73    foreach my $key (sort keys %$info) { 
     74        my $value = $info->{$key};  
    7475        if(ref $value eq 'HASH') { 
    75             while (my ($k, $v) = each %$value) { 
     76            foreach my $k (sort keys %$value) { 
     77                my $v = $value->{$k};  
    7678                $rv .= " " x $indent; 
    7779                $rv .= "<$key name=\"$k\""; 
     
    119121    my $dumper = shift; 
    120122    my $rv = ''; 
    121     while(my ($module, $services) = each %{$self->{store}}) { 
    122         while(my ($service, $info) = each %$services) { 
     123    foreach my $module (sort keys %{$self->{store}}) { 
     124        my $services = $self->{store}->{$module}; 
     125        foreach my $service (sort keys %$services) { 
     126            my $info = $services->{$service}; 
    123127            $rv .= $dumper->($module,$service,$info); 
    124128        } 
     
    134138    my $rv = ''; 
    135139    my $services = $self->{store}->{$module}; 
    136     while(my ($service, $info) = each %$services) { 
     140    foreach my $service (sort keys %$services) { 
     141        my $info = $services->{$service}; 
    137142        $rv .= $dumper->($module,$service,$info); 
    138143    }