~bcsaller/charms/precise/juju-gui/sandbox-charm

« back to all changes in this revision

Viewing changes to hooks/install

  • Committer: Benjamin Saller
  • Date: 2013-04-15 18:22:37 UTC
  • Revision ID: bcsaller@gmail.com-20130415182237-bzbfauyfli3pr2i3
further limit external sources

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
# well.  To do so, we need to install the Juju PPA, which we will do with a
11
11
# couple of functions that are actually maintained in python-shelltoolbox.
12
12
import bootstrap_utils
13
 
bootstrap_utils.install_extra_repositories('ppa:juju/pkgs')
14
 
 
15
 
# Python dependencies must be installed here so that the charm can import and
16
 
# use required libraries.
17
 
PYTHON_DEPENDENCIES = (
18
 
    'python-apt', 'python-charmhelpers', 'python-launchpadlib', 'python-shelltoolbox',
19
 
    'python-tempita',
20
 
)
21
 
check_call(('apt-get', 'install', '-y') + PYTHON_DEPENDENCIES)
 
13
 
 
14
config = bootstrap_utils.get_config()
 
15
allow_external = config.get('allow-external-sources', True)
 
16
 
 
17
if allow_external:
 
18
    bootstrap_utils.install_extra_repositories('ppa:juju/pkgs')
 
19
 
 
20
    # Python dependencies must be installed here so that the charm can import and
 
21
    # use required libraries.
 
22
    PYTHON_DEPENDENCIES = (
 
23
        'python-apt', 'python-charmhelpers', 'python-launchpadlib', 'python-shelltoolbox',
 
24
        'python-tempita',
 
25
    )
 
26
    check_call(('apt-get', 'install', '-y') + PYTHON_DEPENDENCIES)
22
27
 
23
28
 
24
29
# These modules depend on the Python dependencies above being installed so they