Require full PPA name with namespace to destroy it

Bug #1992983 reported by Lucas Kanashiro
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ppa-dev-tools
Fix Released
Undecided
Bryce Harrington

Bug Description

Checking the --help command, it says:

Register a new PPA:
  $ ppa create my-ppa

[...]

Delete the PPA:
  $ ppa destroy my-ppa

To create a new PPA the namespace is not needed and the web page to authorize the tool to have access to your user account is launched, and everything works well. In order to delete it we need to pass the full PPA name and not just the "short name" of the PPA:

$ ppa create test
The authorization page:
 (https://launchpad.net/+authorize-token?oauth_token=XXXXXXXXXXXX&allow_permission=DESKTOP_INTEGRATION)
should be opening in your browser. Use your browser to authorize
this program to access Launchpad on your behalf.
Waiting to hear from Launchpad about your decision...
PPA 'test' created for the following architectures:

  i386, amd64, armhf, ppc64el, s390x, arm64, powerpc

The PPA can be viewed at:

  https://launchpad.net/~lucaskanashiro/+archive/ubuntu/test

You can upload packages to this PPA using:

  dput ppa:lucaskanashiro/test <source.changes>
$ ppa destroy test
Traceback (most recent call last):
  File "/snap/ppa-dev-tools/1/bin/ppa", line 572, in <module>
    retval = main(args)
  File "/snap/ppa-dev-tools/1/bin/ppa", line 561, in main
    return func(lp, config)
  File "/snap/ppa-dev-tools/1/bin/ppa", line 305, in command_destroy
    ppa = get_ppa(lp, config)
  File "/snap/ppa-dev-tools/1/bin/ppa", line 214, in get_ppa
    return Ppa(
  File "/snap/ppa-dev-tools/1/lib/python3.10/site-packages/ppa/ppa.py", line 96, in __init__
    raise ValueError("undefined team_name.")
ValueError: undefined team_name.
$ ppa destroy ppa:lucaskanashiro/test
$ echo $?
0

I'd update the instruction in the --help command with the following:

Delete the PPA:
  $ ppa destroy ppa:my-name/my-ppa

Related branches

Bryce Harrington (bryce)
Changed in ppa-dev-tools:
assignee: nobody → Bryce Harrington (bryce)
status: New → Fix Committed
status: Fix Committed → In Progress
Revision history for this message
Bryce Harrington (bryce) wrote :

I've posted an MP with a branch containing a fix for this bug.

With this update, `ppa destroy my-ppa` will work, since it knows your lp-username and will assume that.

However, I've also taken your advice to make the README use the formal ppa addresses. Even though either way will work now, the formal ppa address is the more general solution and I expect is the approach most people will prefer to use.

Bryce Harrington (bryce)
Changed in ppa-dev-tools:
status: In Progress → Fix Committed
Revision history for this message
Bryce Harrington (bryce) wrote :

[This fix was included in the 0.3 release]

Changed in ppa-dev-tools:
status: Fix Committed → Fix Released
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.