From 8ec8da0491ad89604700b3e29a227966f6d84ba1 Mon Sep 17 00:00:00 2001 From: Perl Tidy Date: Wed, 5 Dec 2018 15:38:52 -0500 Subject: no bug - reformat all the code using the new perltidy rules --- scripts/triage_owners_csv.pl | 66 ++++++++++++++++++++++---------------------- 1 file changed, 33 insertions(+), 33 deletions(-) (limited to 'scripts/triage_owners_csv.pl') diff --git a/scripts/triage_owners_csv.pl b/scripts/triage_owners_csv.pl index e3feeee0f..460b3cc11 100755 --- a/scripts/triage_owners_csv.pl +++ b/scripts/triage_owners_csv.pl @@ -12,8 +12,6 @@ use warnings; use lib qw(. lib local/lib/perl5); - - use Bugzilla; use Bugzilla::Component; use Bugzilla::Constants; @@ -24,7 +22,7 @@ use Text::CSV_XS; Bugzilla->usage_mode(USAGE_MODE_CMDLINE); -my $auto_user = Bugzilla::User->check({ name => 'automation@bmo.tld' }); +my $auto_user = Bugzilla::User->check({name => 'automation@bmo.tld'}); Bugzilla->set_user($auto_user); my $dbh = Bugzilla->dbh; @@ -37,36 +35,38 @@ open(CSV, $filename) || die "Could not open CSV file: $!\n"; # Original Email,LDAP,Bugmail,Product,Component my $csv = Text::CSV_XS->new(); while (my $line = ) { - $csv->parse($line); - my @values = $csv->fields(); - next if !@values; - my ($email, $product_name, $component_name) = @values[2..4]; - print "Updating triage owner for '$product_name :: $component_name' "; - my $product = Bugzilla::Product->new({ name => $product_name, cache => 1 }); - if (!$product) { - print "product '$product_name' does not exist ... skipping.\n"; - next; - } - my $component = Bugzilla::Component->new({ name => $component_name, product => $product, cache => 1 }); - if (!$component) { - print "component '$component_name' does not exist ... skipping.\n"; - next; - } - if (!$email) { - print "... no email ... skipped.\n"; - next; - } - my $user = Bugzilla::User->new({ name => $email, cached => 1 }); - if (!$user) { - print "... email '$email' does not exist ... skipping.\n"; - next; - } - print "to '$email' ... "; - # HACK: See extensions/ComponentWatching/Extension.pm line 175 - Bugzilla->input_params->{watch_user} = $component->watch_user->login; - $component->set_triage_owner($email); - $component->update(); - print "done.\n"; + $csv->parse($line); + my @values = $csv->fields(); + next if !@values; + my ($email, $product_name, $component_name) = @values[2 .. 4]; + print "Updating triage owner for '$product_name :: $component_name' "; + my $product = Bugzilla::Product->new({name => $product_name, cache => 1}); + if (!$product) { + print "product '$product_name' does not exist ... skipping.\n"; + next; + } + my $component = Bugzilla::Component->new( + {name => $component_name, product => $product, cache => 1}); + if (!$component) { + print "component '$component_name' does not exist ... skipping.\n"; + next; + } + if (!$email) { + print "... no email ... skipped.\n"; + next; + } + my $user = Bugzilla::User->new({name => $email, cached => 1}); + if (!$user) { + print "... email '$email' does not exist ... skipping.\n"; + next; + } + print "to '$email' ... "; + + # HACK: See extensions/ComponentWatching/Extension.pm line 175 + Bugzilla->input_params->{watch_user} = $component->watch_user->login; + $component->set_triage_owner($email); + $component->update(); + print "done.\n"; } close(CSV) || die "Could not close CSV file: $!\n"; -- cgit v1.2.3-24-g4f1b