Add DB2 support to glance on redhat platform

Add a new attribute
default["openstack"]["image"]["platform"]["db2_python_packages"]
and fix an attribute typo in registry recipe

Change-Id: Ic84eefd460d1117c60570394e3b402a09a0e3016
Implements: blueprint db2-support
This commit is contained in:
Chen Zhiwei 2013-12-04 22:05:32 -05:00
parent bc3b8270b6
commit fd07a04dd1
6 changed files with 22 additions and 7 deletions

View File

@ -14,13 +14,13 @@
"ref": "2201bd113ffe1742c19811aa4df59a5790af71e3"
},
"apt": {
"locked_version": "2.1.1"
"locked_version": "2.3.0"
},
"database": {
"locked_version": "1.5.2"
"locked_version": "1.4.0"
},
"mysql": {
"locked_version": "3.0.4"
"locked_version": "3.0.0"
},
"openssl": {
"locked_version": "1.1.0"
@ -29,10 +29,10 @@
"locked_version": "1.4.2"
},
"postgresql": {
"locked_version": "3.1.0"
"locked_version": "3.3.4"
},
"aws": {
"locked_version": "0.101.6"
"locked_version": "1.0.0"
},
"xfs": {
"locked_version": "1.1.0"

View File

@ -62,7 +62,7 @@ GEM
erubis (2.7.0)
faraday (0.8.8)
multipart-post (~> 1.2.0)
fauxhai (2.0.0)
fauxhai (2.0.1)
net-ssh
ohai
ffi (1.9.3)

View File

@ -120,6 +120,8 @@ Attributes for the Image service are in the ['openstack']['image'] namespace.
* `openstack['image']['api']['rbd']['rbd_store_pool']` - RADOS pool for images
* `openstack['image']['api']['rbd']['rbd_store_chunk_size']` - Size in MB of chunks for RADOS Store, should be a power of 2
* `openstack['image']['cron']['redirection']` - Redirection of cron output
TODO: Add DB2 support on other platforms
* `openstack['image']['platform']['db2_python_packages']` - Array of DB2 python packages, only available on redhat platform
MQ attributes
@ -171,6 +173,7 @@ Author:: Craig Tracey (<craigtracey@gmail.com>)
Author:: Sean Gallagher (<sean.gallagher@att.com>)
Author:: Mark Vanderwiel (<vanderwl@us.ibm.com>)
Author:: Salman Baset (<sabaset@us.ibm.com>)
Author:: Chen Zhiwei (zhiwchen@cn.ibm.com)
Copyright 2012, Rackspace US, Inc.
Copyright 2012-2013, Opscode, Inc.

View File

@ -150,6 +150,7 @@ when "fedora", "redhat", "centos" # :pragma-foodcritic: ~FC024 - won't fix this
default["openstack"]["image"]["platform"] = {
"postgresql_python_packages" => [ "python-psycopg2" ],
"mysql_python_packages" => [ "MySQL-python" ],
"db2_python_packages" => ["db2-odbc", "python-ibm-db", "python-ibm-db-sa"],
"image_packages" => [ "openstack-glance", "cronie", "python-glanceclient"],
"image_client_packages" => ["python-glanceclient"],
"swift_packages" => [ "openstack-swift" ],

View File

@ -45,7 +45,7 @@ package "curl" do
action :install
end
db_type = node['openstack']['db']['identity']['db_type']
db_type = node['openstack']['db']['image']['db_type']
pkg_key = "#{db_type}_python_packages"
if platform_options.has_key?(pkg_key)
platform_options[pkg_key].each do |pkg|

View File

@ -19,6 +19,17 @@ describe "openstack-image::registry" do
expect(@chef_run).to install_package "MySQL-python"
end
it "installs db2 python packages if explicitly told" do
chef_run = ::ChefSpec::Runner.new ::REDHAT_OPTS
node = chef_run.node
node.set["openstack"]["db"]["image"]["db_type"] = "db2"
chef_run.converge "openstack-image::registry"
["db2-odbc", "python-ibm-db", "python-ibm-db-sa"].each do |pkg|
expect(chef_run).to install_package pkg
end
end
it "installs glance packages" do
expect(@chef_run).to upgrade_package "openstack-glance"
expect(@chef_run).to upgrade_package "cronie"