Merge lp:~yolanda.robla/charm-helpers/fix_add_source into lp:charm-helpers

Proposed by Yolanda Robla
Status: Merged
Merged at revision: 126
Proposed branch: lp:~yolanda.robla/charm-helpers/fix_add_source
Merge into: lp:charm-helpers
Diff against target: 26 lines (+4/-1)
2 files modified
charmhelpers/contrib/templating/contexts.py (+0/-1)
charmhelpers/fetch/__init__.py (+4/-0)
To merge this branch: bzr merge lp:~yolanda.robla/charm-helpers/fix_add_source
Reviewer Review Type Date Requested Status
charmers Pending
Review via email: mp+209054@code.launchpad.net

Description of the change

Skip add_source when no source is present

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
1=== modified file 'charmhelpers/contrib/templating/contexts.py'
2--- charmhelpers/contrib/templating/contexts.py 2014-02-26 10:35:33 +0000
3+++ charmhelpers/contrib/templating/contexts.py 2014-03-03 12:31:59 +0000
4@@ -68,7 +68,6 @@
5 config['charm_dir'] = charm_dir
6 config['local_unit'] = charmhelpers.core.hookenv.local_unit()
7
8-
9 # Don't use non-standard tags for unicode which will not
10 # work when salt uses yaml.load_safe.
11 yaml.add_representer(unicode, lambda dumper,
12
13=== modified file 'charmhelpers/fetch/__init__.py'
14--- charmhelpers/fetch/__init__.py 2014-01-17 15:06:04 +0000
15+++ charmhelpers/fetch/__init__.py 2014-03-03 12:31:59 +0000
16@@ -135,6 +135,10 @@
17
18
19 def add_source(source, key=None):
20+ if source is None:
21+ log('Source is not present. Skipping')
22+ return
23+
24 if (source.startswith('ppa:') or
25 source.startswith('http') or
26 source.startswith('deb ') or

Subscribers

People subscribed via source and target branches