~tvansteenburgh/charms/precise/nvp-transport-node/fix-proof

« back to all changes in this revision

Viewing changes to hooks/hooks.py

  • Committer: Liam Young
  • Date: 2014-07-30 13:08:44 UTC
  • mfrom: (46.1.2 nvp-transport-node)
  • Revision ID: liam.young@canonical.com-20140730130844-ljfr29rwh62vsfid
[jamespage, r=gnuoy] Add support for using tarball from object storage

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
from charmhelpers.fetch import (
15
15
    apt_update, apt_install,
16
16
)
 
17
from charmhelpers.fetch.archiveurl import ArchiveUrlFetchHandler
17
18
import charmhelpers.contrib.network.ovs as ovs
18
19
from utils import get_host_ip
19
20
from nvp import NVPHelper
32
33
def install():
33
34
    archive.install()
34
35
    archive.create_archive(ARCHIVE)
35
 
    archive.include_deb(ARCHIVE, 'payload')
 
36
    if config('ovs-tarball-url') is not None:
 
37
        handler = ArchiveUrlFetchHandler()
 
38
        path = handler.install(config('ovs-tarball-url'))
 
39
        archive.include_deb(ARCHIVE, path)
 
40
    else:
 
41
        archive.include_deb(ARCHIVE, 'payload')
36
42
    archive.configure_local_source(ARCHIVE)
37
43
    apt_update(fatal=True)
38
44