Closed Bug 490673 Opened 15 years ago Closed 15 years ago

WebServices broken in trunk because of datetime_format method missing

Categories

(Bugzilla :: WebService, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 3.6

People

(Reporter: zbraniecki, Assigned: mkanat)

References

Details

(Keywords: regression)

Attachments

(1 file, 1 obsolete file)

import xmlrpclib
bzilla = xmlrpclib.ServerProxy("https://landfill.bugzilla.org/bugzilla-tip/xmlrpc.cgi")
print bzilla.Bug.search({'id':'6323'})

raises:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/xmlrpclib.py", line 1199, in __call__
    return self.__send(self.__name, args)
  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/xmlrpclib.py", line 1489, in __request
    verbose=self.__verbose
  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/xmlrpclib.py", line 1253, in request
    return self._parse_response(h.getfile(), sock)
  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/xmlrpclib.py", line 1392, in _parse_response
    return u.close()
  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/xmlrpclib.py", line 838, in close
    raise Fault(**self._stack[0])
xmlrpclib.Fault: <Fault -32000: 'Can\'t locate object method "datetime_format" via package "Bugzilla::WebService::Bug" at /var/www/html/bugzilla-tip/Bugzilla/WebService.pm line 39.\n'>
Attached patch Possible fix (obsolete) — Splinter Review
Not sure if that is the best/right fix...
Attachment #375068 - Flags: review?(mkanat)
Comment on attachment 375068 [details] [diff] [review]
Possible fix

>Index: Bugzilla/WebService/Server/XMLRPC.pm
>===================================================================
>RCS file: /cvsroot/mozilla/webtools/bugzilla/Bugzilla/WebService/Server/XMLRPC.pm,v
>retrieving revision 1.2
>diff -u -p -r1.2 XMLRPC.pm
>--- Bugzilla/WebService/Server/XMLRPC.pm	31 Mar 2009 06:37:59 -0000	1.2
>+++ Bugzilla/WebService/Server/XMLRPC.pm	29 Apr 2009 18:40:33 -0000
>@@ -20,6 +20,7 @@ package Bugzilla::WebService::Server::XM
> use strict;
> use XMLRPC::Transport::HTTP;
> use Bugzilla::WebService::Server;
>+use HTTP::Date;

Please, forget this change. This is not needed.

> our @ISA = qw(XMLRPC::Transport::HTTP::CGI Bugzilla::WebService::Server);
> 
> use Bugzilla::WebService::Constants;
Attachment #375068 - Flags: review?(mkanat) → review-
Comment on attachment 375068 [details] [diff] [review]
Possible fix

No, that's not right. datetime_format is a Bugzilla-specific method, not something from HTTP::Date.
OS: Mac OS X → All
Hardware: x86 → All
Is 3.4 affected too? If yes, then that's a blocker.
I don't think v3.4 is affected because datetime_format sub was removed in bug 432907 (it was in WebService.pm). I also tested this on 3.4 but it failed with a different error and not this one (bug 490675).
Depends on: bz-json
Keywords: regression
Attached patch v1Splinter Review
It doesn't affect 3.4. This fixes it. datetime_format was just in the wrong place.
Assignee: webservice → mkanat
Attachment #375068 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #375083 - Flags: review?(ghendricks)
Target Milestone: --- → Bugzilla 3.6
Comment on attachment 375083 [details] [diff] [review]
v1

Looks good and tested to fix the Bug.get_history API.

I guess that "double datetime_format call" doesn't need to be backported to 3.4 since it doesn't seem to cause any noticeable problems there for that API.
Attachment #375083 - Flags: review?(ghendricks) → review+
Flags: approval?
Flags: approval? → approval+
Attachment #375083 - Flags: review+
Checking in Bugzilla/WebService.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/WebService.pm,v  <--  WebService.pm
new revision: 1.19; previous revision: 1.18
done
Checking in Bugzilla/WebService/Bug.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/WebService/Bug.pm,v  <--  Bug.pm
new revision: 1.36; previous revision: 1.35
done
Checking in Bugzilla/WebService/Server/XMLRPC.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/WebService/Server/XMLRPC.pm,v  <--  XMLRPC.pm
new revision: 1.3; previous revision: 1.2
done
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: