move create_user to perl API
[cloudstore.git] / gearman / zfs.pl
index a07488e..7ed765a 100755 (executable)
@@ -35,9 +35,11 @@ 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\@u%s $ENV{ZSLICE}" => $_[0] );
+       my $quota = zfs( "zfs get -H -p -o value userquota\@u%s $ENV{ZSLICE}" => $_[0] );
+       return "$used $quota";
+} );
 
 $worker->register_function( $name . '_quota_set' => sub { zfs( 
 "zfs set userquota\@u%s=%s $ENV{ZSLICE}" => $_[0]