← Back to team overview

launchpad-dev team mailing list archive

help with beta error exporting a method

 

I do not know how to resolve an error I see in make build:
    AssertionError: No IEntry adapter found for Interface (web service version: beta).

retractTeamMembership() is exported like other methods in IPersonViewRestricted, eg:

    @call_with(reviewer=REQUEST_USER)
    @operation_parameters(
        person=copy_field(ITeamMembership['person']),
        status=copy_field(ITeamMembership['status']),
        comment=Text(required=False))
    @export_write_operation()
    def addMember(person, reviewer, status=TeamMembershipStatus.APPROVED,
                  comment=None, force_team_add=False,
                  may_subscribe_to_list=True):


=== modified file 'lib/lp/registry/interfaces/person.py'
--- lib/lp/registry/interfaces/person.py	2010-11-18 12:05:34 +0000
+++ lib/lp/registry/interfaces/person.py	2010-11-19 22:31:16 +0000
@@ -1551,6 +1551,11 @@
         to INVITATION_DECLINED.
         """
 
+    @call_with(user=REQUEST_USER)
+    @operation_parameters(
+        team=copy_field(ITeamMembership['team']),
+        comment=Text(required=False))
+    @export_write_operation()
     def retractTeamMembership(team, user, comment=None):
         """Retract this team's membership in the given team.

This small change causes a long TB. I suspect I need to define methods
in a 1.0 or beta API, but I do not know how to version an interface. I
even more puzzled in that the death is an interface I have not changed:
    forSchemaInterface(lp.soyuz.interfaces.archive.IArchive, self.request)
^ this method used in two places in Lp code, and they have nothing to do
with archive. 

OUTPUT:

Writing WADL for version beta to lib/canonical/launchpad/apidoc.tmp/wadl-development-beta.xml.
Traceback (most recent call last):
  File "./utilities/create-lp-wadl-and-apidoc.py", line 93, in <module>
    sys.exit(main(args[1], options.force))
  File "./utilities/create-lp-wadl-and-apidoc.py", line 57, in main
    write(wadl_filename, generate_wadl(version))
  File "/home/curtis/Work/launchpad/retract-membership-0/lib/canonical/launchpad/rest/wadl.py", line 39, in generate_wadl
    return request.publication.getApplication(request)(request)
  File "/home/curtis/Work/lp-sourcedeps/eggs/lazr.restful-0.14.0-py2.6.egg/lazr/restful/_resource.py", line 1805, in __call__
    result = self.do_GET()
  File "/home/curtis/Work/lp-sourcedeps/eggs/lazr.restful-0.14.0-py2.6.egg/lazr/restful/_resource.py", line 1846, in do_GET
    result = self.toWADL().encode("utf-8")
  File "/home/curtis/Work/launchpad/retract-membership-0/lib/canonical/launchpad/systemhomes.py", line 401, in toWADL
    return super(WebServiceApplication, self).toWADL()
  File "/home/curtis/Work/lp-sourcedeps/eggs/lazr.restful-0.14.0-py2.6.egg/lazr/restful/_resource.py", line 1935, in toWADL
    return self.WADL_TEMPLATE.pt_render(namespace)
  File "/home/curtis/Work/lp-sourcedeps/eggs/zope.pagetemplate-3.5.0_p1-py2.6.egg/zope/pagetemplate/pagetemplate.py", line 113, in pt_render
    strictinsert=0, sourceAnnotations=sourceAnnotations)()
  File "/home/curtis/Work/lp-sourcedeps/eggs/zope.tal-3.5.1-py2.6.egg/zope/tal/talinterpreter.py", line 271, in __call__
    self.interpret(self.program)
...
    ob = self._traverser(ob, element, econtext)
  File "/home/curtis/Work/lp-sourcedeps/eggs/zope.pagetemplate-3.5.0_p1-py2.6.egg/zope/pagetemplate/engine.py", line 66, in __call__
    request=request)
  File "/home/curtis/Work/lp-sourcedeps/eggs/zope.traversing-3.8.0-py2.6.egg/zope/traversing/adapters.py", line 138, in traversePathElement
    return traversable.traverse(nm, further_path)
  File "/home/curtis/Work/lp-sourcedeps/eggs/zope.traversing-3.8.0-py2.6.egg/zope/traversing/adapters.py", line 44, in traverse
    attr = getattr(subject, name, _marker)
  File "/home/curtis/Work/lp-sourcedeps/eggs/lazr.restful-0.14.0-py2.6.egg/lazr/restful/tales.py", line 515, in type_link
    utility = self._entry_adapter_utility
  File "/home/curtis/Work/lp-sourcedeps/eggs/lazr.restful-0.14.0-py2.6.egg/lazr/restful/tales.py", line 544, in _entry_adapter_utility
    schema, get_current_web_service_request())
  File "/home/curtis/Work/lp-sourcedeps/eggs/lazr.restful-0.14.0-py2.6.egg/lazr/restful/_resource.py", line 2083, in forSchemaInterface
    % (entry_interface.__name__, request.version)))
AssertionError: No IEntry adapter found for Interface (web service version: beta).
make: *** [lib/canonical/launchpad/apidoc/index.html] Error 1

-- 
__Curtis C. Hovey_________
http://launchpad.net/

Attachment: signature.asc
Description: This is a digitally signed message part


Follow ups