~sdn-charmers/charms/trusty/nova-compute/hugepages

« back to all changes in this revision

Viewing changes to hooks/nova_compute_hooks.py

  • Committer: james.page at ubuntu
  • Date: 2015-04-16 20:05:38 UTC
  • mfrom: (117.1.6 nova-compute)
  • Revision ID: james.page@ubuntu.com-20150416200538-j545uzgj4wg33xuu
[coreycb,r=james-page] Add deploy from source support.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
)
29
29
 
30
30
from charmhelpers.contrib.openstack.utils import (
 
31
    config_value_changed,
31
32
    configure_installation_source,
 
33
    git_install_requested,
32
34
    openstack_upgrade_available,
33
35
    os_requires_version,
34
36
)
43
45
from nova_compute_utils import (
44
46
    create_libvirt_secret,
45
47
    determine_packages,
 
48
    git_install,
46
49
    import_authorized_keys,
47
50
    import_keystone_ca_cert,
48
51
    initialize_ssh_keys,
84
87
def install():
85
88
    execd_preinstall()
86
89
    configure_installation_source(config('openstack-origin'))
 
90
 
87
91
    apt_update()
88
92
    apt_install(determine_packages(), fatal=True)
89
93
 
 
94
    git_install(config('openstack-origin-git'))
 
95
 
90
96
 
91
97
@hooks.hook('config-changed')
92
98
@restart_on_change(restart_map())
95
101
        assert_charm_supports_ipv6()
96
102
 
97
103
    global CONFIGS
98
 
    if openstack_upgrade_available('nova-common'):
99
 
        CONFIGS = do_openstack_upgrade()
 
104
    if git_install_requested():
 
105
        if config_value_changed('openstack-origin-git'):
 
106
            git_install(config('openstack-origin-git'))
 
107
    else:
 
108
        if openstack_upgrade_available('nova-common'):
 
109
            CONFIGS = do_openstack_upgrade()
100
110
 
101
111
    sysctl_dict = config('sysctl')
102
112
    if sysctl_dict: