[rt-users] Further RTx::Shredder Errors
Mathew Snyder
theillien at yahoo.com
Sat Feb 24 23:48:37 EST 2007
I have been looking at this and still haven't figured out what I need to change
to make it work. Ruslan mentioned the User plugin. There's a Users plugin but
no singular. the User.pm file under the Shredder directory has no method for
setting the resolver as far as I can tell. User.pm under the Plugin directory
has the SetResolver method though. I used it but I guess I haven't used it
correctly.
Can someone help me out please?
Mathew
Mathew Snyder wrote:
> I think I'm making progress. This is what I now have
>
> RTx::Shredder::Init( force => 1 );
> my $shredder = new RTx::Shredder(RT::SystemUser);
> my $resolver = new RTx::Shredder::Plugin::Users(RT::SystemUser);
> 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' );
> my $email;
> foreach $email (@emails){
> my $user = new RT::User(RT::SystemUser);
> $user->LoadByEmail($email);
> next unless $user->id;
> $resolver->SetResolver(Shredder => 10);
> $shredder->PutObject(Object => $user);
> }
> $shredder->WipeoutAll;
> }else{
> exit;
> }
>
> Now, instead of getting an error regarding resolvers, I am getting
>
> [crit]: Odd number of elements in anonymous hash at
> /usr/local/rt-3.6.1/local/lib/RTx/Shredder/Plugin/Base.pm line 23.
> (/usr/local/rt-3.6.1/lib/RT.pm:317)
> Odd number of elements in anonymous hash at
> /usr/local/rt-3.6.1/local/lib/RTx/Shredder/Plugin/Base.pm line 23.
>
> Looking at some of the code in there I think I should be using $resolver to
> establish the "replace_relations" bit and then fitting that into the $shredder
> somehow. Any thoughts?
>
> Mathew
>
> Mathew Snyder wrote:
>> >From this
>>
>> RTx::Shredder::Init( force => 1 );
>> my $shredder = new RTx::Shredder(RT::SystemUser);
>> 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’ );
>> my $email;
>> foreach $email (@emails){
>> my $user = new RT::User(RT::SystemUser);
>> $user->LoadByEmail($email);
>> next unless $user->id;
>> $shredder->PutObject(Object => $user);
>> }
>> $shredder->WipeoutAll;
>> # system "/usr/local/rt-3.6.1/local/sbin/rtx-shredder --force
>> --plugin 'Users=status,any;email,$email;replace_relations,Nobody'";
>> #
>> system("/usr/local/rt-3.6.1/local/sbin/rtx-shredder","--force","--plugin","Users=status,any;email,$email;replace_relations,Nobody");
>> }
>>
>> I get this
>>
>> [Wed Feb 21 08:44:20 2007] [crit]: Couldn't wipeout object: Couldn't find
>> resolver for dependency 'RT::User-240410 (depends on,resolvable dependency)
>> RT::Attachment-270285' at /usr/local/rt-3.6.1/local/lib/RTx/Shredder.pm line
>> 393. (/usr/local/rt-3.6.1/lib/RT.pm:317)
>> Couldn't wipeout object: Couldn't find resolver for dependency 'RT::User-240410
>> (depends on,resolvable dependency) RT::Attachment-270285' at
>> /usr/local/rt-3.6.1/local/lib/RTx/Shredder.pm line 393.
>>
>> Can someone shed some light on why this is failing?
>>
>> Also, the above, commented-out line regarding SetFile produces this
>>
>> Unrecognized character \xE2 at ./delete_spam_users.pl line 91
>>
>> I don't know what the \xE2 is as I couldn't find anything on Google about it.
>>
>> Mathew
>> _______________________________________________
>> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
>>
>> Community help: http://wiki.bestpractical.com
>> Commercial support: sales at bestpractical.com
>>
>>
>> Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
>> Buy a copy at http://rtbook.bestpractical.com
>>
> _______________________________________________
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
>
> Community help: http://wiki.bestpractical.com
> Commercial support: sales at bestpractical.com
>
>
> Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
> Buy a copy at http://rtbook.bestpractical.com
>
More information about the rt-users
mailing list