Add DB2 support to cinder on redhat platform

Add a new attribute
default["openstack"]["block-storage"]["platform"]["db2_python_packages"]

Change-Id: Ibfaef276788322867a9461235eeac8d5c706c3f5
Implements: blueprint db2-support
This commit is contained in:
Chen Zhiwei
2013-12-04 22:38:02 -05:00
parent 3f739f7a78
commit 4fe53e18ca
5 changed files with 37 additions and 1 deletions

View File

@@ -43,6 +43,8 @@ Attributes
==========
* `openstack["block-storage"]["db"]["username"]` - cinder username for database
TODO: Add DB2 support on other platforms
* `openstack["block-storage"]["platform"]["db2_python_packages"]` - Array of DB2 python packages, only available on redhat platform
MQ attributes
-------------
@@ -139,7 +141,7 @@ License and Author
| **Copyright** | Copyright (c) 2012-2013, AT&T Services, Inc. |
| **Copyright** | Copyright (c) 2013, Opscode, Inc. |
| **Copyright** | Copyright (c) 2013, SUSE Linux GmbH |
| **Copyright** | Copyright (c) 2013, IBM, Corp |
| **Copyright** | Copyright (c) 2013, IBM, Corp. |
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@@ -164,6 +164,7 @@ when 'fedora', 'redhat', 'centos' # :pragma-foodcritic: ~FC024 - won't fix this
default['openstack']['block-storage']['platform'] = {
'mysql_python_packages' => ['MySQL-python'],
'db2_python_packages' => ['db2-odbc', 'python-ibm-db', 'python-ibm-db-sa'],
'postgresql_python_packages' => ['python-psycopg2'],
'cinder_common_packages' => ['openstack-cinder'],
'cinder_api_packages' => ['python-cinderclient'],

View File

@@ -16,6 +16,17 @@ describe "openstack-block-storage::api" do
expect(@chef_run).to upgrade_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"]["volume"]["db_type"] = "db2"
chef_run.converge "openstack-block-storage::api"
["db2-odbc", "python-ibm-db", "python-ibm-db-sa"].each do |pkg|
expect(chef_run).to upgrade_package pkg
end
end
it "installs postgresql python packages if explicitly told" do
chef_run = ::ChefSpec::Runner.new ::REDHAT_OPTS
node = chef_run.node

View File

@@ -23,6 +23,17 @@ describe "openstack-block-storage::scheduler" do
expect(@chef_run).to upgrade_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"]["volume"]["db_type"] = "db2"
chef_run.converge "openstack-block-storage::scheduler"
["db2-odbc", "python-ibm-db", "python-ibm-db-sa"].each do |pkg|
expect(chef_run).to upgrade_package pkg
end
end
it "installs postgresql python packages if explicitly told" do
chef_run = ::ChefSpec::Runner.new ::REDHAT_OPTS
node = chef_run.node

View File

@@ -12,6 +12,17 @@ describe "openstack-block-storage::volume" do
expect(@chef_run).to upgrade_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"]["volume"]["db_type"] = "db2"
chef_run.converge "openstack-block-storage::volume"
["db2-odbc", "python-ibm-db", "python-ibm-db-sa"].each do |pkg|
expect(chef_run).to upgrade_package pkg
end
end
it "installs postgresql python packages if explicitly told" do
chef_run = ::ChefSpec::Runner.new ::REDHAT_OPTS
node = chef_run.node