Can't call named operations on lp.me

Bug #846187 reported by Bryce Harrington
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Triaged
High
Unassigned

Bug Description

The team createPPA() does not appear to add a ppa to the user:

ppa_name = "lp123456"
team = launchpad.me
results = team.createPPA(
    name=ppa_name,
    displayname=ppa_name,
    description=ppa_name)
team.lp_save()
print "-- saved --"

ppa = team.getPPAByName(name=ppa_name)
print "Created PPA %s for %s" %(ppa.name, team.name)

results in:

-- saved --
Traceback (most recent call last):
  File "./create-ppa.py", line 16, in <module>
    ppa = team.getPPAByName(name=ppa_name)
  File "/usr/lib/python2.7/dist-packages/lazr/restfulclient/resource.py", line 558, in __call__
    url, in_representation, http_method, extra_headers=extra_headers)
  File "/usr/lib/python2.7/dist-packages/lazr/restfulclient/_browser.py", line 281, in _request
    raise error
lazr.restfulclient.errors.NotFound: HTTP Error 404: Not Found
Response headers:
---
-content-encoding: gzip
content-length: 24
content-type: text/plain
date: Sat, 10 Sep 2011 03:05:27 GMT
server: zope.server.http (HTTP)
status: 404
vary: Accept,Accept-Encoding
via: 1.1 api.launchpad.net
x-lazr-notifications: []
x-powered-by: Zope (www.zope.org), Python (www.python.org)
---
Response body:
---
No such ppa: 'lp123456'.
---

Confirmed no ppa shows up via the web interface either.
Guessing it should work, since it's documented as available on the launchpadapi page?

Tags: api ppa
Aaron Bentley (abentley)
Changed in launchpad:
status: New → Triaged
importance: Undecided → High
Revision history for this message
Julian Edwards (julian-edwards) wrote :

If this isn't working, it's a critical regression! However, I've tried to re-create and I have found the problem. For some weird reason, replacing

team = launchpad.me

with

team = launchpad.people['julian-edwards']

fixes the issue. I've no idea why launchpad.me doesn't work.

tags: added: api ppa
Revision history for this message
William Grant (wgrant) wrote :

You can't call named operations directly on launchpad.me, as that points to /people/+me, which redirects. Bug #583318 makes reference to this issue, but I don't know if there's a bug for it specifically.

Revision history for this message
Bryce Harrington (bryce) wrote :

Confirmed that

  team = launchpad.people[launchpad.me]

works around the problem. That's probably going to be sufficient for my needs, you can repurpose this bug to the .me aspect of the issue, or close this out as you feel appropriate.

Thanks!

William Grant (wgrant)
summary: - createPPA() api call doesn't create ppas
+ Can't call named operations on lp.me
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.