~malte.swart/vmbuilder/vmbuilder

« back to all changes in this revision

Viewing changes to VMBuilder/plugins/ubuntu/dapper.py

  • Committer: Malte Swart
  • Date: 2015-08-21 01:21:30 UTC
  • Revision ID: launchpad@malteswart.de-20150821012130-6l1e9e8g2jy5vyal
apt: support for now only one additional apt repo / key

The used argument parser splits arguments on : and , Therefor it is
very difficult to process urls as values. Limit to one argument
until real solution is found.

Show diffs side-by-side

added added

removed removed

Lines of Context:
238
238
                                                                              'ppa' : ppa,
239
239
                                                                              'suite' : suite })
240
240
 
241
 
        for repo in self.context.get_setting('extra-repos'):
242
 
            name, url = repo.split(':', 1)
243
 
            content = "deb {url} {suite} main\n".format(url=url, suite=suite)
244
 
            self.install_file("/etc/apt/sources.list.d/{}.list".format(name), contents=content)
 
241
        name, url = self.context.get_setting('extra-repos').split(':', 1)
 
242
        content = "deb {url} {suite} main\n".format(url=url, suite=suite)
 
243
        self.context.install_file("/etc/apt/sources.list.d/{}.list".format(name), contents=content)
245
244
 
246
 
        for key in self.context.get_setting('extra-aptkeys'):
247
 
            content = open(key).read()
248
 
            self.run_in_target('apt-key', 'add', '-', stdin=content)
 
245
        content = open(self.context.get_setting('extra-aptkeys'), 'r').read()
 
246
        self.run_in_target('apt-key', 'add', '-', stdin=content)
249
247
 
250
248
        # If setting up the final mirror, allow apt-get update to fail
251
249
        # (since we might be on a complete different network than the