Bugzilla – Attachment 163756 Details for
Bug 34611
Add a script for pseudonymizing existing data
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34611: (follow-up) Add commit option to misc/maintenance/pseudonymize_statistics.pl
Bug-34611-follow-up-Add-commit-option-to-miscmaint.patch (text/plain), 1.96 KB, created by
Nick Clemens (kidclamp)
on 2024-03-23 16:31:37 UTC
(
hide
)
Description:
Bug 34611: (follow-up) Add commit option to misc/maintenance/pseudonymize_statistics.pl
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2024-03-23 16:31:37 UTC
Size:
1.96 KB
patch
obsolete
>From 56b8c3b6140e58c84469e8d38a0ca66776da71b9 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Sat, 23 Mar 2024 16:24:52 +0000 >Subject: [PATCH] Bug 34611: (follow-up) Add commit option to > misc/maintenance/pseudonymize_statistics.pl > >To test: >1 - Perform some transactions >2 - Enable Pseudonymization >3 - perl misc/maintenance/pseudonymize_statistics.pl -v >4 - Confirm test run an nothing changed >5 - perl misc/maintenance/pseudonymize_statistics.pl -v -c >6 - Confirm statistics are pseudonymized >--- > misc/maintenance/pseudonymize_statistics.pl | 13 +++++++++++-- > 1 file changed, 11 insertions(+), 2 deletions(-) > >diff --git a/misc/maintenance/pseudonymize_statistics.pl b/misc/maintenance/pseudonymize_statistics.pl >index 2f950b5c6de..ac8ca7c2a8d 100755 >--- a/misc/maintenance/pseudonymize_statistics.pl >+++ b/misc/maintenance/pseudonymize_statistics.pl >@@ -26,12 +26,13 @@ use Koha::PseudonymizedTransactions; > > use C4::Context; > >-my ( $help, $verbose, $before ); >+my ( $help, $verbose, $before, $confirm ); > my $result = GetOptions( > 'h|help' => \$help, > 'v|verbose' => \$verbose, > 'b|before:s' => \$before, >-) || pod2usage(1); >+ 'c|confirm' => \$confirm, >+) || pod2usage(0); > > if ($help) { > pod2usage(0); >@@ -60,6 +61,10 @@ if ( $statistics->count && $existing_pseudo_stats ) { > exit unless uc($continue) eq 'Y'; > } > >+if( !$confirm ){ >+ print $statistics->count() . " statistics would have been pseudonymized\n" if $verbose; >+ exit 1; >+} > > while ( my $statistic = $statistics->next ) { > $statistic->pseudonymize(); >@@ -94,6 +99,10 @@ Verbose mode. > > This option allows for specifying a date to pseudonmyize before. Useful if you have enabled pseudonymization and want to pseudonymize transactions before that date. If not passed all statistics before current time will be pseudonymized. > >+=item B<-c|--confirm> >+ >+Without this parameter script will be run in test mode, no changes will be made >+ > =back > > =head1 AUTHOR >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 34611
:
154808
|
154809
|
157753
|
157754
|
157755
|
157763
|
157764
|
157765
|
157869
|
157870
|
157871
|
157872
|
157877
|
157878
|
157879
|
157880
|
159909
|
159910
|
159911
|
159912
|
163344
|
163345
|
163346
|
163347
|
163756
|
163757