aboutsummaryrefslogtreecommitdiffstats
path: root/charms/trusty/contrail-webui/hooks/install
blob: d981389ce11835a3b5a64e743d861360334a4f43 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/python

import shutil

import setup
setup.pre_install()

from charmhelpers.core import hookenv
from charmhelpers.fetch import (
    configure_sources,
    apt_upgrade,
    apt_install,
)

PACKAGES = [ "contrail-web-controller", "nodejs",
             "supervisor", "contrail-utils" ]

def install():
    hookenv.log('Installing contrail-webui')

    # set apt preferences
    shutil.copy('files/40contrail', '/etc/apt/preferences.d')

    configure_sources(True, "install-sources", "install-keys")
    apt_upgrade(fatal=True, dist=True)
    apt_install(PACKAGES, fatal=True)
    setup.fix_services()

if __name__ == "__main__":
    install()