From 759243934df6a3a1d4bcfacc58ce842206923731 Mon Sep 17 00:00:00 2001 From: Vladimir Panteleev Date: Sun, 18 Mar 2018 07:00:50 +0200 Subject: Bug 1446236 - Allow customizing the name of the "nobody" user (nobody@mozilla.org) --- scripts/eject-users-from-groups.pl | 2 +- scripts/generate_bmo_data.pl | 6 +++--- scripts/move_os.pl | 2 +- scripts/movebugs.pl | 6 ++++-- scripts/nagios_blocker_checker.pl | 2 +- scripts/remove_idle_group_members.pl | 2 +- scripts/reset_default_user.pl | 2 +- 7 files changed, 12 insertions(+), 10 deletions(-) (limited to 'scripts') diff --git a/scripts/eject-users-from-groups.pl b/scripts/eject-users-from-groups.pl index 52e2bbbf3..4b27be83d 100755 --- a/scripts/eject-users-from-groups.pl +++ b/scripts/eject-users-from-groups.pl @@ -23,7 +23,7 @@ Bugzilla->usage_mode(USAGE_MODE_CMDLINE); my $dbh = Bugzilla->dbh; my @remove_group_names; -my $nobody_name = 'nobody@mozilla.org'; +my $nobody_name = Bugzilla->params->{'nobody_user'}; my $admin_name = 'automation@bmo.tld'; GetOptions( diff --git a/scripts/generate_bmo_data.pl b/scripts/generate_bmo_data.pl index 6356762c8..8a9f72d17 100755 --- a/scripts/generate_bmo_data.pl +++ b/scripts/generate_bmo_data.pl @@ -158,7 +158,7 @@ $group->update(); my @users = ( { - login => 'nobody@mozilla.org', + login => Bugzilla->params->{'nobody_user'}, realname => 'Nobody; OK to take it and work on it', password => '*' }, @@ -267,7 +267,7 @@ my @products = ( name => 'General', description => 'For bugs in Firefox which do not fit into ' . 'other more specific Firefox components', - initialowner => 'nobody@mozilla.org', + initialowner => Bugzilla->params->{'nobody_user'}, initialqaowner => '', initial_cc => [], watch_user => 'general@firefox.bugs' @@ -287,7 +287,7 @@ my @products = ( name => 'General', description => 'This is the component for issues specific to bugzilla.mozilla.org ' . 'that do not belong in other components.', - initialowner => 'nobody@mozilla.org', + initialowner => Bugzilla->params->{'nobody_user'}, initialqaowner => '', initial_cc => [], watch_user => 'general@bugzilla.bugs' diff --git a/scripts/move_os.pl b/scripts/move_os.pl index 546b47c7e..963188261 100755 --- a/scripts/move_os.pl +++ b/scripts/move_os.pl @@ -40,7 +40,7 @@ my $dbh = Bugzilla->dbh; my $timestamp = $dbh->selectrow_array('SELECT LOCALTIMESTAMP(0)'); my $bug_ids = $dbh->selectcol_arrayref(q{SELECT bug_id FROM bugs WHERE bugs.op_sys = ?}, undef, $from_os); my $field = Bugzilla::Field->check({ name => 'op_sys', cache => 1 }); -my $nobody = Bugzilla::User->check({ name => 'nobody@mozilla.org', cache => 1 }); +my $nobody = Bugzilla::User->check({ name => Bugzilla->params->{'nobody_user'}, cache => 1 }); my $bug_count = @$bug_ids; if ($bug_count == 0) { diff --git a/scripts/movebugs.pl b/scripts/movebugs.pl index 2c643cdfb..55a43d943 100755 --- a/scripts/movebugs.pl +++ b/scripts/movebugs.pl @@ -73,10 +73,12 @@ my $component_field_id = $dbh->selectrow_array( $component_field_id or die "Can't find field ID for 'component' field\n"; +my $nobody = Bugzilla->params->{'nobody_user'}; my $user_id = $dbh->selectrow_array( - "SELECT userid FROM profiles WHERE login_name='nobody\@mozilla.org'"); + "SELECT userid FROM profiles WHERE login_name=?", + undef, $nobody); $user_id - or die "Can't find user ID for 'nobody\@mozilla.org'\n"; + or die "Can't find user ID for '$nobody'\n"; $dbh->bz_start_transaction(); diff --git a/scripts/nagios_blocker_checker.pl b/scripts/nagios_blocker_checker.pl index 0a9ec96b6..8c4277507 100755 --- a/scripts/nagios_blocker_checker.pl +++ b/scripts/nagios_blocker_checker.pl @@ -28,7 +28,7 @@ my $config = { assignee => '', product => '', component => '', - unassigned => 'nobody@mozilla.org', + unassigned => Bugzilla->params->{'nobody_user'}, # severities severity => 'major,critical,blocker', # time in hours to wait before paging/warning diff --git a/scripts/remove_idle_group_members.pl b/scripts/remove_idle_group_members.pl index 74e8658ff..e4ef88bc1 100755 --- a/scripts/remove_idle_group_members.pl +++ b/scripts/remove_idle_group_members.pl @@ -78,7 +78,7 @@ foreach my $group_id (keys %remove_data) { $dbh->bz_commit_transaction(); # nobody@mozilla.org cannot recieve email - next if $group->owner->login eq 'nobody@mozilla.org'; + next if $group->owner->login eq Bugzilla->params->{'nobody_user'}; _send_email($group, \@users_removed); } diff --git a/scripts/reset_default_user.pl b/scripts/reset_default_user.pl index d0d2534f2..942afda17 100755 --- a/scripts/reset_default_user.pl +++ b/scripts/reset_default_user.pl @@ -52,7 +52,7 @@ if (!$product || $help } # We will need these for entering into bugs_activity -my $who = Bugzilla::User->new({ name => 'nobody@mozilla.org' }); +my $who = Bugzilla::User->new({ name => Bugzilla->params->{'nobody_user'} }); my $field = Bugzilla::Field->new({ name => $field_name }); trick_taint($product); -- cgit v1.2.3-24-g4f1b