[rt-users] Delete User accounts through a perl script
Potla, Ashish Bassaliel
c_apotla at qualcomm.com
Tue Feb 23 08:00:48 EST 2010
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");
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20100223/6eb156e0/attachment.htm>
More information about the rt-users
mailing list