1. This code: 56 if ( $help || !$confirm ) { 57 ... 70 exit(); 71 } means that unless you specify --confirm you will never be able to run the script - it will just print the usage and exit. That means --test is useless. 2. The script has both of these options: -c --confirm: Script will do nothing without this parameter -t --test: Test mode, does not delete records. What happens if you specify both? Or none? I think test mode should be the default (when no options are specified) and changes to the database should only be done when --confirm is specified. This would be consistent with other scripts, I think.
Created attachment 69981 [details] [review] Bug 19712: Fix test mode for delete_records_via_leader.pl Test plan: perl misc/cronjobs/delete_records_via_leader.pl => Should display a warning perl misc/cronjobs/delete_records_via_leader.pl --test => Should not display a warning and script should not apply changes perl misc/cronjobs/delete_records_via_leader.pl --confirm => Should not display a warning and script should apply changes
Created attachment 70732 [details] [review] Bug 19712: Followup adding missing use Pod::Usage pod2usage call failed otherwise.
Created attachment 72925 [details] [review] Bug 19712: Fix test mode for delete_records_via_leader.pl Test plan: perl misc/cronjobs/delete_records_via_leader.pl => Should display a warning perl misc/cronjobs/delete_records_via_leader.pl --test => Should not display a warning and script should not apply changes perl misc/cronjobs/delete_records_via_leader.pl --confirm => Should not display a warning and script should apply changes Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Created attachment 72926 [details] [review] Bug 19712: Followup adding missing use Pod::Usage pod2usage call failed otherwise. Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Created attachment 73752 [details] [review] Bug 19712: Fix test mode for delete_records_via_leader.pl Test plan: perl misc/cronjobs/delete_records_via_leader.pl => Should display a warning perl misc/cronjobs/delete_records_via_leader.pl --test => Should not display a warning and script should not apply changes perl misc/cronjobs/delete_records_via_leader.pl --confirm => Should not display a warning and script should apply changes Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 73753 [details] [review] Bug 19712: Followup adding missing use Pod::Usage pod2usage call failed otherwise. Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Pushed to master for 18.05, thanks to everybody involved!