Merge lp:~dholbach/snapcraft/fix-for-empty-stage_packages-in-plugins into lp:~snappy-dev/snapcraft/core

Proposed by Daniel Holbach on 2015-09-15
Status: Merged
Approved by: Sergio Schvezov on 2015-09-15
Approved revision: 164
Merged at revision: 164
Proposed branch: lp:~dholbach/snapcraft/fix-for-empty-stage_packages-in-plugins
Merge into: lp:~snappy-dev/snapcraft/core
Diff against target: 12 lines (+1/-1)
1 file modified
snapcraft/__init__.py (+1/-1)
To merge this branch: bzr merge lp:~dholbach/snapcraft/fix-for-empty-stage_packages-in-plugins
Reviewer Review Type Date Requested Status
Sergio Schvezov 2015-09-15 Approve on 2015-09-15
Review via email: mp+271090@code.launchpad.net

Commit Message

fix crash when stage_packages is defined in the yaml for the plugin, but empty (getattr does not use [] as default return value in that case)

To post a comment you must log in.
Sergio Schvezov (sergiusens) wrote :

Thanks for this, I have this available in a complicated branch, I'll take your fix as it is isolated :-)

In case you want to take a look https://code.launchpad.net/~sergiusens/snapcraft/config/+merge/270989 ;-)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'snapcraft/__init__.py'
2--- snapcraft/__init__.py 2015-09-11 13:37:13 +0000
3+++ snapcraft/__init__.py 2015-09-15 10:03:01 +0000
4@@ -99,7 +99,7 @@
5
6 def setup_stage_packages(self):
7 ubuntu = snapcraft.repo.Ubuntu(self.ubuntudir)
8- part_stage_packages = getattr(self.options, 'stage_packages', [])
9+ part_stage_packages = getattr(self.options, 'stage_packages', []) or []
10 if self.PLUGIN_STAGE_PACKAGES or part_stage_packages:
11 ubuntu.get(self.PLUGIN_STAGE_PACKAGES + part_stage_packages)
12 ubuntu.unpack(self.installdir)

Subscribers

People subscribed via source and target branches