~longsleep/snapcraft/snapcraft-debs-plugin

« back to all changes in this revision

Viewing changes to snapcraft/__init__.py

  • Committer: Snappy Tarmac
  • Author(s): Daniel Holbach
  • Date: 2015-09-15 11:23:51 UTC
  • mfrom: (163.1.1 snapcraft)
  • Revision ID: snappy_tarmac-20150915112351-kd44s4u9y3cn5kme
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) by dholbach approved by sergiusens

Show diffs side-by-side

added added

removed removed

Lines of Context:
99
99
 
100
100
    def setup_stage_packages(self):
101
101
        ubuntu = snapcraft.repo.Ubuntu(self.ubuntudir)
102
 
        part_stage_packages = getattr(self.options, 'stage_packages', [])
 
102
        part_stage_packages = getattr(self.options, 'stage_packages', []) or []
103
103
        if self.PLUGIN_STAGE_PACKAGES or part_stage_packages:
104
104
            ubuntu.get(self.PLUGIN_STAGE_PACKAGES + part_stage_packages)
105
105
            ubuntu.unpack(self.installdir)