[rt-users] Shredder Error
Ruslan Zakirov
ruz at bestpractical.com
Wed Jul 11 21:46:41 EDT 2007
See below, note that some lines are commented.
On 6/30/07, Mathew Snyder <theillien at yahoo.com> wrote:
> I'm trying to remove users using the methods within Shredder. After gathering
> all the email addresses I need to remove I call Shredder like such:
>
> RTx::Shredder::Init( force => 1 );
> my $shredder = new RTx::Shredder(RT::SystemUser);
> # my $resolver = new RTx::Shredder::Plugin::Users(RT::SystemUser);
> # $resolver->SetResolver(Shredder => 10);
my $resolver = sub {
my %args = (@_);
my $t = $args{'TargetObject'};
foreach my $method ( qw(Creator LastUpdatedBy) ) {
next unless $t->_Accessible( $method => 'read' );
$t->__Set( Field => $method, Value => 10 );
}
};
$shredder->PutResolver( BaseClass => 'RT::User', Code => $resolver );
> # $shredder->PutResolver($resolver);
> if ($ans =~ m/^(y|yes)$/i){
> my ($fname, $fh) = $shredder->SetFile( FromStorage => 0, FileName =>
> '/usr/local/rt-3.6.1/var/data/RTx-Shredder/Shredder-Users_XXXX.sql' );
> foreach my $email (@emails){
> my $user = new RT::User(RT::SystemUser);
> $user->LoadByEmail($email);
> next unless $user->id;
> $shredder->PutObject(Object => $user);
> }
> $shredder->WipeoutAll;
> }else{
> exit;
> }
>
> Using this gives me
> Odd number of elements in anonymous hash at
> /usr/local/rt-3.6.1/local/lib/RTx/Shredder/Plugin/Base.pm line 23.
>
> I looked at the perldocs and verified that Objects => $user is a valid value.
> However, I am wondering if it should be something like $user->EmailAddress or
> something.
>
> Can someone shed some light on this for me?
>
> Thanks
> Mathew
> --
> Keep up with me and what I'm up to: http://theillien.blogspot.com
--
Best regards, Ruslan.
More information about the rt-users
mailing list