Various fixes. Cache openstack release.
This commit is contained in:
parent
6fd930008a
commit
7ba9370a42
@ -229,14 +229,26 @@ def network_plugin_attribute(plugin, attr):
|
||||
return None
|
||||
|
||||
|
||||
os_rel = None
|
||||
|
||||
|
||||
def os_release():
|
||||
global os_rel
|
||||
if os_rel:
|
||||
return os_rel
|
||||
os_rel = (get_os_codename_package('nova-common', fatal=False) or
|
||||
get_os_codename_install_source(config('openstack-origin')) or
|
||||
'essex')
|
||||
return os_rel
|
||||
|
||||
|
||||
def network_manager():
|
||||
'''
|
||||
Deals with the renaming of Quantum to Neutron in H and any situations
|
||||
that require compatability (eg, deploying H with network-manager=quantum,
|
||||
upgrading from G).
|
||||
'''
|
||||
release = (get_os_codename_package('nova-common', fatal=False) or
|
||||
get_os_codename_install_source() or 'essex')
|
||||
release = os_release()
|
||||
manager = config('network-manager').lower()
|
||||
|
||||
if manager not in ['quantum', 'neutron']:
|
||||
|
@ -9,9 +9,8 @@ from copy import deepcopy
|
||||
from charmhelpers.contrib.openstack import templating, context
|
||||
|
||||
from charmhelpers.contrib.openstack.utils import (
|
||||
get_os_codename_package,
|
||||
save_script_rc as _save_script_rc,
|
||||
)
|
||||
save_script_rc as _save_script_rc)
|
||||
|
||||
|
||||
from charmhelpers.core.hookenv import (
|
||||
config,
|
||||
@ -24,7 +23,7 @@ from charmhelpers.core.hookenv import (
|
||||
|
||||
import nova_cc_context
|
||||
|
||||
from misc_utils import network_manager, NeutronCCContext
|
||||
from misc_utils import network_manager, NeutronCCContext, os_release
|
||||
|
||||
TEMPLATES = 'templates/'
|
||||
|
||||
@ -125,10 +124,10 @@ def resource_map():
|
||||
|
||||
|
||||
def register_configs():
|
||||
release = get_os_codename_package('nova-common', fatal=False) or 'essex'
|
||||
release = os_release()
|
||||
configs = templating.OSConfigRenderer(templates_dir=TEMPLATES,
|
||||
openstack_release=release)
|
||||
for cfg, rscs in resource_map.iteritems():
|
||||
for cfg, rscs in resource_map().iteritems():
|
||||
configs.register(cfg, rscs['contexts'])
|
||||
return configs
|
||||
|
||||
@ -187,7 +186,7 @@ def do_openstack_upgrade():
|
||||
|
||||
def volume_service():
|
||||
'''Specifies correct volume API for specific OS release'''
|
||||
os_vers = get_os_codename_package('nova-common')
|
||||
os_vers = os_release()
|
||||
if os_vers == 'essex':
|
||||
return 'nova-volume'
|
||||
elif os_vers == 'folsom': # support both drivers in folsom.
|
||||
|
2
revision
2
revision
@ -1 +1 @@
|
||||
263
|
||||
269
|
||||
|
Loading…
x
Reference in New Issue
Block a user