Skip to content

Commit

Permalink
Argh. Gonna get total in there eventually.
Browse files Browse the repository at this point in the history
  • Loading branch information
swelljoe committed Jul 28, 2017
1 parent b670bec commit e5fdeb8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/Virtualmin/Config.pm
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ sub run {
for (@plugins) {
my $pkg = "Virtualmin::Config::Plugin::$_";
load $pkg || die "Loading Plugin failed: $_";
my $plugin = $pkg->new( { total => $total } );
my $plugin = $pkg->new({$total => $total});
$plugin->actions();
if ($self->{test} && $plugin->can('tests')) {
$plugin->tests();
Expand Down
5 changes: 2 additions & 3 deletions lib/Virtualmin/Config/Plugin.pm
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ my $log = Log::Log4perl->get_logger("virtualmin-config-system");
sub new {
my ($class, %args) = @_;

my $self = {name => $args{name}, depends => $args{depends}, total => $args{ total }};
my $self = {name => $args{name}, depends => $args{depends}, total => $args{total}};
bless $self, $class;

return $self;
Expand Down Expand Up @@ -54,9 +54,8 @@ sub total {
sub spin {
my $self = shift;
my $name = $self->name();
my $total = $self->total();
my $message = shift // "Configuring " . $name;
$message = "[" . YELLOW . $count . RESET . "/" . GREEN . $total .
$message = "[" . YELLOW . $count . RESET . "/" . GREEN . $self->total() .
RESET . "] " . $message;
$count++;
$log->info($message);
Expand Down

0 comments on commit e5fdeb8

Please sign in to comment.