~smoser/ubuntu/maverick/cloud-init/lp942961-apt-pipeline

« back to all changes in this revision

Viewing changes to cloudinit/CloudConfig/cc_apt_update_upgrade.py

  • Committer: Scott Moser
  • Date: 2010-06-18 19:48:13 UTC
  • mto: This revision was merged to the branch mainline in revision 20.
  • Revision ID: smoser@ubuntu.com-20100618194813-1hk4vuin8w2zxypj
Tags: upstream-0.5.12
ImportĀ upstreamĀ versionĀ 0.5.12

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# vi: ts=4 expandtab
 
2
#
 
3
#    Copyright (C) 2009-2010 Canonical Ltd.
 
4
#
 
5
#    Author: Scott Moser <scott.moser@canonical.com>
 
6
#
 
7
#    This program is free software: you can redistribute it and/or modify
 
8
#    it under the terms of the GNU General Public License version 3, as
 
9
#    published by the Free Software Foundation.
 
10
#
 
11
#    This program is distributed in the hope that it will be useful,
 
12
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
#    GNU General Public License for more details.
 
15
#
 
16
#    You should have received a copy of the GNU General Public License
 
17
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
1
18
import cloudinit.util as util
2
19
import subprocess
 
20
import traceback
3
21
import os
4
22
 
5
23
def handle(name,cfg,cloud,log,args):
23
41
        for e in errors:
24
42
            log.warn("Source Error: %s\n" % ':'.join(e))
25
43
 
 
44
    dconf_sel = util.get_cfg_option_str(cfg, 'debconf_selections', False)
 
45
    if dconf_sel:
 
46
        log.debug("setting debconf selections per cloud config")
 
47
        try:
 
48
            util.subp(('debconf-set-selections', '-'), dconf_sel)
 
49
        except:
 
50
            log.error("Failed to run debconf-set-selections")
 
51
            log.debug(traceback.format_exc())
 
52
 
26
53
    pkglist = []
27
54
    if 'packages' in cfg:
28
55
        if isinstance(cfg['packages'],list):