[Fedora-security-commits] fedora-security/tools/lib/Libexig Bugzilla.pm, 1.3, 1.4

fedora-security-commits at redhat.com fedora-security-commits at redhat.com
Wed Jan 16 17:27:04 UTC 2008


Author: thoger

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

Modified Files:
	Bugzilla.pm 
Log Message:
add possiblity to call arbitrary XMLRPC method



Index: Bugzilla.pm
===================================================================
RCS file: /cvs/fedora/fedora-security/tools/lib/Libexig/Bugzilla.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Bugzilla.pm	14 Jan 2008 16:33:12 -0000	1.3
+++ Bugzilla.pm	16 Jan 2008 17:27:01 -0000	1.4
@@ -240,4 +240,30 @@
 	$self->close_bug($bug, $resolution, $dupeid, $fixedin, $comment);
 }
 
+# Call arbitrary Bugzilla XMLRPC method
+#
+# Arguments: method, method-specific arguments
+sub rpccall
+{
+	my $self = shift;
+	my $method = shift or die 'No XMLRPC method specified!';
+
+	print "Calling bugzilla.$method with arguments:\n", Dumper(\@_)
+		if $self->{'debug'};
+
+	my $call = $self->{rpc}->call('bugzilla.'.$method, @_);
+	my $result = $call->result;
+
+	if (!defined($result)) {
+		print STDERR "XMLRPC call to bugzilla.$method failed:\n";
+		print STDERR $call->faultstring;
+		return undef;
+	}
+
+	print "Bugzilla answer to bugzilla.$method:\n", Dumper($result), "\n"
+		if $self->{'debug'};
+
+	return $result;
+}
+
 1;




More information about the Fedora-security-commits mailing list