[Fedora-security-commits] fedora-security/tools/lib/Libexig Bugzilla.pm, 1.1.2.1, 1.1.2.2

fedora-security-commits at redhat.com fedora-security-commits at redhat.com
Tue Jan 8 16:15:53 UTC 2008


Author: thoger

Update of /cvs/fedora/fedora-security/tools/lib/Libexig
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv1535/Libexig

Modified Files:
      Tag: lkundrak-tools-ng
	Bugzilla.pm 
Log Message:
add add_comment method
turn add_private_comment to simple wrapper around add_comment



Index: Bugzilla.pm
===================================================================
RCS file: /cvs/fedora/fedora-security/tools/lib/Libexig/Attic/Bugzilla.pm,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- Bugzilla.pm	6 Jan 2008 03:31:53 -0000	1.1.2.1
+++ Bugzilla.pm	8 Jan 2008 16:15:51 -0000	1.1.2.2
@@ -147,17 +147,24 @@
 	return undef;
 }
 
-# Add private comment (unless dryrun) to a bug
-sub add_private_comment
+# Add comment to a bug (unless in dryrun mode)
+# Arguments: bug id, comment, make comment private (0/1)
+sub add_comment
 {
 	my $self = shift;
-	return 0 if $self->{dryrun};
-
 
 	my $bug = shift or die 'No bug!';
 	my $comment = shift or die 'No comment!';
+	my $private;  $private = shift or $private= 0;
+
+	if ($self->{dryrun}) {
+		print STDERR 'Would add following comment to bug: #'.$bug."\n";
+		print STDERR "$comment\n";
+		return 0;
+	}
 
-	my $call = $self->{rpc}->call('bugzilla.addComment', $bug, $comment, @{$self->{creds}}, 1);
+	my $call = $self->{rpc}->call('bugzilla.addComment', $bug, $comment,
+		@{$self->{creds}}, $private);
 
 	my $result = $call->result
 		or die $call->faultstring;
@@ -167,4 +174,14 @@
 	return undef;
 }
 
+# Add private comment to a bug
+sub add_private_comment
+{
+	my $self = shift;
+	my $bug = shift;
+	my $comment = shift;
+
+	$self->add_comment($bug, $comment, 1);
+}
+
 1;




More information about the Fedora-security-commits mailing list