test send_file with spaces in both arguments
[cloudstore.git] / gearman / zfs.pl
index a07488e..5de977b 100755 (executable)
@@ -35,12 +35,14 @@ sub zfs {
 my $name = $ENV{ZSLICE};
 $name =~ s/\W+/_/g;
 
-$worker->register_function( $name . '_quota_get' => sub { zfs( 
-"zfs get -H -p -o value userused\@u%s $ENV{ZSLICE}" => $_[0]
-) } );
+$worker->register_function( $name . '_quota_get' => sub {
+       my $used = zfs( "zfs get -H -p -o value userused\@%s $ENV{ZSLICE}" => $_[0] );
+       my $quota = zfs( "zfs get -H -p -o value userquota\@%s $ENV{ZSLICE}" => $_[0] );
+       return "$used $quota";
+} );
 
 $worker->register_function( $name . '_quota_set' => sub { zfs( 
-"zfs set userquota\@u%s=%s $ENV{ZSLICE}" => $_[0]
+"zfs set userquota\@%s=%s $ENV{ZSLICE}" => $_[0]
 ) } );
 
 warn "$0 $name pid $$ waitng for jobs ZFS slice $ENV{ZSLICE}\n";