fetch.add_source silently ignores unknown source

Bug #1269718 reported by Stuart Bishop
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Charm Helpers
Fix Released
Medium
Stuart Bishop

Bug Description

fetch.add_source('https://example.com') silently does nothing, because it doesn't recognize it as a valid source.

Related branches

Revision history for this message
Adam Gandelman (gandelman-a) wrote :
Revision history for this message
Stuart Bishop (stub) wrote :

This bug will be fixed when an unknown source causes an exception to be raised or a warning to be logged.

Revision history for this message
Ryan Harper (raharper) wrote :

When invoking apt-add-repository --yes, there is no validation of the url at all. Currently add_source rejects https, but the MP will address that.

Once add_source supports https urls, I don't think we can raise an exception when add-apt-repository is doing real work and doesn't error.

(foudres) ~ % grep -r example /etc/apt/sources.list*
(foudres) ~ % sudo apt-add-repository --yes "https://example.com" ; echo $?
0
(foudres) ~ % grep -r example /etc/apt/sources.list*
/etc/apt/sources.list:deb https://example.com saucy main
/etc/apt/sources.list:# deb-src https://example.com saucy main

Revision history for this message
Stuart Bishop (stub) wrote : Re: [Bug 1269718] Re: fetch.add_source silently ignores unknown source

On Fri, Jan 17, 2014 at 10:11 PM, Ryan Harper
<email address hidden> wrote:
> When invoking apt-add-repository --yes, there is no validation of the
> url at all. Currently add_source rejects https, but the MP will address
> that.
>
> Once add_source supports https urls, I don't think we can raise an
> exception when add-apt-repository is doing real work and doesn't error.

I used https: in the example as it was the most obvious case.

We still can warn or raise an exception if add_source doesn't
understand its input at all, such as a misspelled keyword like
'proposed\n'.

--
Stuart Bishop <email address hidden>

Stuart Bishop (stub)
Changed in charm-helpers:
status: New → In Progress
assignee: nobody → Stuart Bishop (stub)
importance: Undecided → Medium
Stuart Bishop (stub)
Changed in charm-helpers:
status: In Progress → Fix Committed
Stuart Bishop (stub)
Changed in charm-helpers:
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.