From 415e12779124ed547f98ba93e57e85443f939003 Mon Sep 17 00:00:00 2001 From: Peter Vinson Date: Tue, 18 Mar 2008 18:30:12 -0700 Subject: [PATCH] default alg should be 'straw' not '4' --- src/crushtool | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/crushtool b/src/crushtool index 208c93eb76187..8806d840ffd08 100755 --- a/src/crushtool +++ b/src/crushtool @@ -1,10 +1,13 @@ #!/usr/bin/perl -use CrushWrapper; use Config::General; use Tie::IxHash; use Data::Dumper; +use strict; + +use CrushWrapper; + tie my %conf, "Tie::IxHash"; my $wrap = new CrushWrapper::CrushWrapper; @@ -93,7 +96,7 @@ foreach my $item_type (keys %{$arr->{'types'}->{'type'}}) { foreach my $bucket_type (keys %{$arr->{'buckets'}}) { - print "doing bucket type $type\n"; + print "doing bucket type $bucket_type\n"; foreach my $bucket_name (keys %{$arr->{'buckets'}->{$bucket_type}}) { print "... bucket: $bucket_name\n"; @@ -104,20 +107,19 @@ foreach my $bucket_type (keys %{$arr->{'buckets'}}) { my $bucket_id = $arr->{'buckets'}->{$bucket_type}->{$bucket_name}->{'id'}; my $alg = $arr->{'buckets'}->{$bucket_type}->{$bucket_name}->{'alg'}; - $alg = $alg_types->{'straw'} if !$alg; + $alg = 'straw' if !$alg; - print "alg is: $alg\n"; - print "b_id is: $bucket_id\n"; + print "... alg is: $alg\n"; + print "... b_id is: $bucket_id\n"; # bucket_id, alg, type, size, items, weights #TODO: pass the correct value for type to add_bucket my $result = $wrap->add_bucket($bucket_id, $alg_types->{$alg}, 0, scalar(@item_ids), \@item_ids, []); - print "... $result\n\n"; + print "... result: $result\n\n"; } } - -print "Line: " . __LINE__ ."\n"; +print "Done!\n"; =item -- 2.39.5