Changeset f612bf0cf2d302696dd777cd41ad9ceeb1c3372f in xas-supervisor


Ignore:
Timestamp:
12/09/15 16:37:01 (3 years ago)
Author:
root <root@…>
Branches:
master
Children:
669163f99a2a8ccdbc9cb8c35b4d9590d81db050
Parents:
c381f17e441575b3b3c05fcc82b1b0687bc0264a
git-author:
root <root@…> (12/09/15 16:37:01)
git-committer:
root <root@…> (12/09/15 16:37:01)
Message:

Fixing logic problems

Location:
trunk/lib/XAS
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/XAS/Apps/Supervisor/Client.pm

    rc381f17e441575b3b3c05fcc82b1b0687bc0264a rf612bf0cf2d302696dd777cd41ad9ceeb1c3372f  
    3030 
    3131        $result = $rpc->start($self->start); 
    32         $message = $self->message('supervior_status', $self->status, $result); 
     32        $message = $self->message('supervisor_status', $self->start, $result); 
    3333 
    3434    } elsif (defined($self->stop)) { 
    3535 
    3636        $result = $rpc->stop($self->stop); 
    37         $message = $self->message('supervior_status', $self->status, $result); 
     37        $message = $self->message('supervisor_status', $self->stop, $result); 
    3838 
    3939    } elsif (defined($self->pause)) { 
    4040 
    4141        $result = $rpc->pause($self->pause); 
    42         $message = $self->message('supervior_status', $self->status, $result); 
     42        $message = $self->message('supervsior_status', $self->pause, $result); 
    4343 
    4444    } elsif (defined($self->resume)) { 
    4545 
    4646        $result = $rpc->resume($self->resume); 
    47         $message = $self->message('supervior_status', $self->status, $result); 
     47        $message = $self->message('supervsior_status', $self->resume, $result); 
    4848 
    4949    } elsif (defined($self->list)) { 
     
    5555 
    5656        $result = $rpc->status($self->status); 
    57         $message = $self->message('supervior_status', $self->status, $result); 
     57        $message = $self->message('supervisor_status', $self->status, $result); 
    5858 
    5959    } 
  • trunk/lib/XAS/Msgs/Supervisor.msg

    rfdbba6d01c088f2248591d4df8b5792bc62525ab rf612bf0cf2d302696dd777cd41ad9ceeb1c3372f  
    99[messages] 
    1010supervisor_unable   = unable to find method %s for %s 
    11 supervisor_status   = %s is currently "%s" 
     11supervisor_status   = the status of %s is currently "%s" 
    1212supervisor_nostatus = unable to determine status for %s 
    1313supervisor_list     = the following processes are known: %s 
     14supervisor_action   = %s: performing a "%s" on "%s" 
  • trunk/lib/XAS/Supervisor/Controller.pm

    rc381f17e441575b3b3c05fcc82b1b0687bc0264a rf612bf0cf2d302696dd777cd41ad9ceeb1c3372f  
    4343    $poe_kernel->state('list_processes', $self, '_list_processes'); 
    4444 
    45     # define the RPC methods, linked to the events 
     45    # define the RPC methods, these are linked to the above events 
    4646 
    4747    $self->methods->insert('kill_process'); 
     48    $self->methods->insert('start_process'); 
    4849    $self->methods->insert('stop_process'); 
    4950    $self->methods->insert('stat_process'); 
     
    5152    $self->methods->insert('resume_process'); 
    5253    $self->methods->insert('list_processes'); 
    53     $self->methods->insert('check_status'); 
    5454 
    5555    # walk the chain 
     
    8888    if (my $process = $self->processes->{$name}) { 
    8989 
    90         $process->stop_process(); 
     90        my $session = $process->alias; 
     91 
     92        $poe_kernel->call($session, 'stop_process'); 
    9193        $self->check_status($params, $ctx, PROC_STOPPED); 
     94        $self->log->info_msg('supervisor_action', $alias, 'stop_process', $name); 
    9295 
    9396    } else { 
     
    112115    if (my $process = $self->processes->{$name}) { 
    113116 
    114         $process->kill_process(); 
     117        my $session = $process->alias; 
     118 
     119        $poe_kernel->call($session, 'kill_process'); 
    115120        $self->check_status($params, $ctx, PROC_KILLED); 
     121        $self->log->info_msg('supervisor_action', $alias, 'kill_process', $name); 
    116122 
    117123    } else { 
     
    140146 
    141147        $self->process_response($status, $ctx); 
     148        $self->log->info_msg('supervisor_action', $alias, 'stat_process', $name); 
    142149 
    143150    } else { 
     
    162169    if (my $process = $self->processes->{$name}) { 
    163170 
    164         $process->start_process(); 
     171        my $session = $process->alias; 
     172 
     173        $poe_kernel->call($session, 'start_process'); 
    165174        $self->check_status($params, $ctx, PROC_RUNNING); 
     175        $self->log->info_msg('supervisor_action', $alias, 'start_process', $name); 
    166176 
    167177    } else { 
     
    186196    if (my $process = $self->processes->{$name}) { 
    187197 
    188         $process->pause_process(); 
     198        my $session = $process->alias; 
     199 
     200        $poe_kernel->call($session, 'pause_process'); 
    189201        $self->check_status($params, $ctx, PROC_PAUSED); 
     202        $self->log->info_msg('supervisor_action', $alias, 'pause_process', $name); 
    190203 
    191204    } else { 
     
    210223    if (my $process = $self->processes->{$name}) { 
    211224 
    212         $process->resume_process(); 
     225        my $session = $process->alias; 
     226 
     227        $poe_kernel->call($session, 'resume_process'); 
    213228        $self->check_status($params, $ctx, PROC_RUNNING); 
     229        $self->log->info_msg('supervisor_action', $alias, 'resume_process', $name); 
    214230 
    215231    } else { 
     
    287303 
    288304    $self->process_response(\@response, $ctx); 
     305    $self->log->info_msg('supervisor_action', $alias, 'list_processes', ''); 
    289306 
    290307} 
Note: See TracChangeset for help on using the changeset viewer.