Permalink
Browse files

Subject: Prevent service restarts when in dryrun mode

Trac: Refs #101

- Fix to prevent service restarts from being triggered during a dryrun.
  • Loading branch information...
1 parent 4139610 commit 22e5ddf21daefe81391be7ab98723b2a32ac8539 rkhardalian committed Nov 11, 2009
Showing with 10 additions and 4 deletions.
  1. +10 −4 lib/Spine/Plugin/RestartServices.pm
@@ -119,14 +119,20 @@ sub restart_services
if ($service)
{
$c->cprint("restarting service $service", 2);
- exec_initscript($c, $service, $command, 1)
- or $rval++;
+ unless ($DRYRUN)
+ {
+ exec_initscript($c, $service, $command, 1)
+ or $rval++;
+ }
}
else
{
$c->cprint("executing command $command", 2);
- exec_command($c, $command, 1)
- or $rval++;
+ unless ($DRYRUN)
+ {
+ exec_command($c, $command, 1)
+ or $rval++;
+ }
}
utime(time, time, @{$rshash{$key}});
}

0 comments on commit 22e5ddf

Please sign in to comment.