report refresh_file_list errors
[cloudstore.git] / lib / CloudStore / API.pm
index 5ac4175..39a27cd 100644 (file)
@@ -35,7 +35,8 @@ sub new {
 
 sub slice_dir_port {
        my ($self,$slice) = @_;
-       my ( undef, $dir, $port, undef ) = getgrnam($slice) || die "getgrnam $slice: $!";
+       my ( undef, $dir, $port, undef ) = getgrnam($slice);
+       die "getgrnam $slice: $!" if $!;
        warn "# slice_dir_port $slice = $dir $port\n";
        return ( $dir, $port );
 }
@@ -105,7 +106,7 @@ sub create_user {
        # FIXME update quota only on create?
        $self->gearman_do( $self->dir2gearman( $dir, 'quota', 'set' ) => "$found $new_quota" );
 
-       return $found;
+       return 'u' . $found;
 }
 
 sub mkbasepath {
@@ -306,7 +307,9 @@ sub refresh_file_list {
        my $full_path = "$user->{dir}/.meta/files";
        if ( -e $full_path ) {
                warn "## refresh_file_list $full_path";
-               unlink $full_path;
+               unlink $full_path || warn "unlink $full_path: $!";
+       } else {
+               warn "## refresh_file_list $full_path missing";
        }
 }