Merge ~ddstreet/software-properties:lp1965180 into software-properties:ubuntu/master

Proposed by Dan Streetman
Status: Merged
Merged at revision: 0369d8f5c14f339136941e9bad44fba1ae988582
Proposed branch: ~ddstreet/software-properties:lp1965180
Merge into: software-properties:ubuntu/master
Diff against target: 40 lines (+12/-1)
1 file modified
softwareproperties/ppa.py (+12/-1)
Reviewer Review Type Date Requested Status
Ubuntu Core Development Team Pending
Review via email: mp+417981@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/softwareproperties/ppa.py b/softwareproperties/ppa.py
2index 0e1bff1..eb4f371 100644
3--- a/softwareproperties/ppa.py
4+++ b/softwareproperties/ppa.py
5@@ -56,6 +56,8 @@ class PPAShortcutHandler(ShortcutHandler):
6 self._lpteam = None # Person/Team LP object
7 self._lpppa = None # PPA Archive LP object
8
9+ self._is_sourceslist = False
10+
11 # one of these will set teamname and ppaname, and maybe _source_entry
12 if not any((self._match_ppa(shortcut),
13 self._match_uri(shortcut),
14@@ -66,6 +68,13 @@ class PPAShortcutHandler(ShortcutHandler):
15 self._filebase = "%s-ubuntu-%s" % (self.teamname, self.ppaname)
16 self._set_auth()
17
18+ # Make sure we can find/access the PPA, lp:#1965180
19+ if self._is_sourceslist:
20+ try:
21+ self.lpppa
22+ except ShortcutException:
23+ raise InvalidShortcutException(_("ERROR: Can't find ppa"))
24+
25 if not self._source_entry:
26 comps = self.components
27 if not comps:
28@@ -190,9 +199,11 @@ class PPAShortcutHandler(ShortcutHandler):
29
30 def _match_sourceslist(self, shortcut):
31 try:
32- return self._match_handler(SourcesListShortcutHandler(shortcut))
33+ handler = self._match_handler(SourcesListShortcutHandler(shortcut))
34 except InvalidShortcutException:
35 return False
36+ self._is_sourceslist = True
37+ return handler
38
39 def _match_handler(self, handler):
40 parsed = urlparse(handler.SourceEntry().uri)

Subscribers

People subscribed via source and target branches