Delete User accounts through a perl script

Hello I consistently keep getting this error : Couldn’t wipeout object: at /opt/prj/rt/rt3/local/lib/RTx/Shredder.pm line 427.

At the end of this mail is my subroutine -
If I change the Wipeout to WipeoutAll , it just takes on forever at that statement.

Let me know if you have any other logic to delete user accounts from a perl script.

Please Help,
Thanks
-Ashish

sub delete_user {
# Grab the user id
my $id = shift;

# Form an RT::User object string for the user
my $object_string = 'RT::User-' . $id;
# Create a single item array with the object string
my @users_to_delete = ($object_string);

# Create a shredder object and pass it the array
my $shredder = new RTx::Shredder( force => 1 );
$shredder->PutObjects( Objects => \@users_to_delete );

# Shred the user
eval {
    $shredder->Wipeout
};

if ( $@ ) {
    return (-1, "Failed to delete user with id '$id': $@");
}
return (1, "User with id '$id' deleted successfully.\n");

}

Hi, Even on CLI : ./rt-shredder --plugin 'Objects=User,39236’
Is taking forever. It has been running for quite sometime till now.

-AshishFrom: Potla, Ashish Bassaliel
Sent: Tuesday, February 23, 2010 6:30 PM
To: rt-users@lists.bestpractical.com
Subject: Delete User accounts through a perl script

Hello I consistently keep getting this error : Couldn’t wipeout object: at /opt/prj/rt/rt3/local/lib/RTx/Shredder.pm line 427.

At the end of this mail is my subroutine -
If I change the Wipeout to WipeoutAll , it just takes on forever at that statement.

Let me know if you have any other logic to delete user accounts from a perl script.

Please Help,
Thanks
-Ashish

sub delete_user {
# Grab the user id
my $id = shift;

# Form an RT::User object string for the user
my $object_string = 'RT::User-' . $id;
# Create a single item array with the object string
my @users_to_delete = ($object_string);

# Create a shredder object and pass it the array
my $shredder = new RTx::Shredder( force => 1 );
$shredder->PutObjects( Objects => \@users_to_delete );

# Shred the user
eval {
    $shredder->Wipeout
};

if ( $@ ) {
    return (-1, "Failed to delete user with id '$id': $@");
}
return (1, "User with id '$id' deleted successfully.\n");

}