Move to use "get_password" for heat cookbook

Rebase and resolve conficts with latest codes

Move to use "get_password" instead of "{user,service,db}_password"

Change-Id: Ia14344b81c75724b35bf556e42fd4297428f4631
This commit is contained in:
hanzhf 2014-01-22 13:06:25 +08:00
parent 18299e6508
commit 80c8412f32
3 changed files with 14 additions and 11 deletions

View File

@ -48,7 +48,7 @@ platform_options["#{db_type}_python_packages"].each do |pkg|
end
db_user = node['openstack']['db']['orchestration']['username']
db_pass = db_password 'heat'
db_pass = get_password 'db', 'heat'
sql_connection = db_uri('orchestration', db_user, db_pass)
identity_endpoint = endpoint 'identity-api'
@ -57,7 +57,7 @@ heat_api_endpoint = endpoint 'orchestration-api'
heat_api_cfn_endpoint = endpoint 'orchestration-api-cfn'
heat_api_cloudwatch_endpoint = endpoint 'orchestration-api-cloudwatch'
service_pass = service_password 'openstack-orchestration'
service_pass = get_password 'service', 'openstack-orchestration'
# TODO(jaypipes): Move this logic and stuff into the openstack-common
# library cookbook.
@ -75,7 +75,7 @@ if node['openstack']['mq']['orchestration']['service_type'] == 'rabbitmq'
if node['openstack']['mq']['orchestration']['rabbit']['ha']
rabbit_hosts = rabbit_servers
end
rabbit_pass = user_password node['openstack']['mq']['orchestration']['rabbit']['userid']
rabbit_pass = get_password 'user', node['openstack']['mq']['orchestration']['rabbit']['userid']
end
directory '/etc/heat' do

View File

@ -32,7 +32,7 @@ auth_url = ::URI.decode identity_admin_endpoint.to_s
heat_endpoint = endpoint 'orchestration-api'
heat_cfn_endpoint = endpoint 'orchestration-api-cfn'
service_pass = service_password 'openstack-orchestration'
service_pass = get_password 'service', 'openstack-orchestration'
service_tenant_name = node['openstack']['orchestration']['service_tenant_name']
service_user = node['openstack']['orchestration']['service_user']
service_role = node['openstack']['orchestration']['service_role']

View File

@ -20,15 +20,18 @@ def orchestration_stubs # rubocop:disable MethodLength
::Chef::Recipe.any_instance.stub(:secret)
.with('secrets', 'openstack_identity_bootstrap_token')
.and_return 'bootstrap-token'
::Chef::Recipe.any_instance.stub(:db_password).and_return ''
::Chef::Recipe.any_instance.stub(:user_password).and_return ''
::Chef::Recipe.any_instance.stub(:user_password)
.with('guest')
::Chef::Recipe.any_instance.stub(:get_password)
.with('db', 'heat')
.and_return 'heat'
::Chef::Recipe.any_instance.stub(:get_password)
.with('user', 'guest')
.and_return 'rabbit-pass'
::Chef::Recipe.any_instance.stub(:user_password)
.with('admin-user')
::Chef::Recipe.any_instance.stub(:get_password)
.with('user', 'admin-user')
.and_return 'admin-pass'
::Chef::Recipe.any_instance.stub(:service_password).with('openstack-orchestration')
::Chef::Recipe.any_instance.stub(:get_password)
.with('service', 'openstack-orchestration')
.and_return 'heat-pass'
::Chef::Application.stub(:fatal!)
end