]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
default alg should be 'straw' not '4'
authorPeter Vinson <peter@hq.newdream.net>
Wed, 19 Mar 2008 01:30:12 +0000 (18:30 -0700)
committerSage Weil <sage@newdream.net>
Thu, 20 Mar 2008 01:19:36 +0000 (18:19 -0700)
src/crushtool

index 208c93eb761871569006c6b4685aaebd57df4575..8806d840ffd089f5ec15b687d50e1ee6aeea858e 100755 (executable)
@@ -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