aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/MGA/Advisories.pm23
1 files changed, 21 insertions, 2 deletions
diff --git a/lib/MGA/Advisories.pm b/lib/MGA/Advisories.pm
index 0cf72d3..d29d706 100644
--- a/lib/MGA/Advisories.pm
+++ b/lib/MGA/Advisories.pm
@@ -256,8 +256,7 @@ sub assign_id {
$buffer = $msg;
my $found_keyword = 0;
if (scalar($bug->{keywords}) > 0) {
- my $keywords = $bug->{keywords};
- foreach my $keyword (@$keywords) {
+ foreach my $keyword (@{$bug->{keywords}}) {
if ('validated_update' eq $keyword) {
$found_keyword = 1;
last;
@@ -352,6 +351,26 @@ sub assign_id {
if ($failed) {
print STDERR "Error: Cross check failed.\n";
+ if ($found_keyword) {
+ ReadMode 4; # Turn off controls keys
+ print "Post failure message to Bugzilla and reset 'validated_update' keyword (requires login)? [y/N]: ";
+ my $key = 'x';
+ while ( $key ne "\n" && $key ne "y" && $key ne "Y" && $key ne "n" && $key ne "N" ) {
+ $key = ReadKey(0);
+ }
+ ReadMode 0; # Reset tty mode before exiting
+ if ( $key eq "\n" || $key eq "n" || $key eq "N" ) {
+ print " ✘\n";
+ } else {
+ print " ✔\n";
+
+ if (call_bz('Bug.update', { ids => [$bugnum], comment => { body => "Update ID assignment failed\n\n$buffer\n\n'validated_update' keyword reset." }, keywords => { set => grep { $_ ne 'validated_update' } @{$bug->{keywords}} } })) {
+ print "Successfully posted to Bugzilla\n";
+ } else {
+ print "Failed to post to Bugzilla\n";
+ }
+ }
+ }
return;
}
} else {