Version specific install of packages enabled

This commit is contained in:
Bilal Baqar 2015-10-02 08:08:10 -07:00
parent 7fbc457f3a
commit e46fa862bc
3 changed files with 34 additions and 3 deletions

View File

@ -25,3 +25,13 @@ options:
default: null
type: string
description: Provide the respective keys of the install sources
plumgrid-build:
default: 'latest'
type: string
description: |
Provide the build version of PLUMgrid packages that needs to be installed
iovisor-build:
default: 'latest'
type: string
description: |
Provide the build version of iovisor package that needs to be installed

View File

@ -204,8 +204,8 @@ def neutron_plugins():
database=config('database'),
ssl_dir=NEUTRON_CONF_DIR)],
'services': [],
'packages': [['plumgrid-lxc'],
['iovisor-dkms']],
'packages': ['plumgrid-lxc',
'iovisor-dkms'],
'server_packages': ['neutron-server',
'neutron-plugin-plumgrid'],
'server_services': ['neutron-server']

View File

@ -19,6 +19,9 @@ from charmhelpers.core.host import (
service_start,
service_stop,
)
from charmhelpers.fetch import (
apt_cache
)
from charmhelpers.contrib.storage.linux.ceph import modprobe
from charmhelpers.core.host import set_nic_mtu
from charmhelpers.contrib.openstack import templating
@ -71,7 +74,25 @@ def determine_packages():
Returns list of packages required by PLUMgrid Gateway as specified
in the neutron_plugins dictionary in charmhelpers.
'''
return neutron_plugin_attribute('plumgrid', 'packages', 'neutron')
pkgs = []
tag = 'latest'
for pkg in neutron_plugin_attribute('plumgrid', 'packages', 'neutron'):
if 'plumgrid' in pkg:
tag = config('plumgrid-build')
elif pkg == 'iovisor-dkms':
tag = config('iovisor-build')
if tag == 'latest':
pkgs.append(pkg)
else:
if tag in [i.ver_str for i in apt_cache()[pkg].version_list]:
pkgs.append('%s=%s' % (pkg, tag))
else:
error_msg = \
"Build version '%s' for package '%s' not available" \
% (tag, pkg)
raise ValueError(error_msg)
return pkgs
def register_configs(release=None):