fill enviroment nr when just calling methods on packages
authorDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 7 Sep 2009 21:57:35 +0000 (21:57 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 7 Sep 2009 21:57:35 +0000 (21:57 +0000)
lib/PXElator/httpd.pm

index 9606f51..a7ac548 100644 (file)
@@ -394,7 +394,9 @@ warn "XXX pids = ", dump( $daemons::pids );
        } elsif ( $path =~ m{^/start_stop/(\S+)} ) {
                print $client redirect, daemons::start_stop($1,$param);
        } elsif ( $path =~ m{^/action/([^/]+)/(.+)} ) {
-               $1->$2();
+               my ( $package, $method ) = ( $1, $2 );
+               $ENV{nr} = $1 if $package =~ s{\.(\d+)$}{};
+               $package->$method();
                print $client redirect;
        } elsif ( $path =~ m{^/kill/static/(\d+)} ) {
                print $client redirect;