~lutostag/charms/trusty/ci-configurator/simplify-config-repo-updates

« back to all changes in this revision

Viewing changes to hooks/hooks.py

  • Committer: Mario Splivalo
  • Date: 2014-07-02 09:30:44 UTC
  • mfrom: (71.2.4 config-updates)
  • Revision ID: mario.splivalo@canonical.com-20140702093044-4v7yuuzdr3q7ax13
[hopem,mariosplivalo,r=]

    * Adds force-package-install config option.

      When installing packages listed in control.yml, it may be desirable
      to disregard local config changes and force the installation of upgrades.
      Adds the ability to do this via config option, with the default being
      disabled.

    * Adds "distro" as a supported install source for jenkins-job-builder.

      JJB hit Ubuntu in raring. It should be possible to install this without
      the painful offline bundling if charm is deployed to a recent enough Ubuntu.

      Also avoids an import error in gerrit helper by ensuring paramiko is
      installed.

      NOTE: Leaving default for jjb-install-source to install from git as we
      are still installing on precise and 'distro' is >= 13.04 only so leaving
      default as precise-compatible.

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
 
10
10
import common
11
11
 
 
12
from charmhelpers.fetch import apt_install, filter_installed_packages
12
13
from charmhelpers.canonical_ci import cron
13
14
from charmhelpers.core.hookenv import (
14
15
    charm_dir,
20
21
    UnregisteredHookError,
21
22
)
22
23
 
23
 
 
24
24
hooks = Hooks()
25
25
 
26
26
 
29
29
    common.ensure_user()
30
30
    if not os.path.exists(common.CONFIG_DIR):
31
31
        os.mkdir(common.CONFIG_DIR)
 
32
    apt_install(filter_installed_packages(common.PACKAGES), fatal=True)
32
33
 
33
34
 
34
35
@hooks.hook()