Use get_secret instead of secret

The new get_secret method allows the 'secrets' databag to be renamed,
just like all other databags.

Change-Id: Ic8be5d19a112d78e22716c0cd571efc7186ac9ce
Related-Bug: #1288784
This commit is contained in:
Luis A. Garcia 2014-04-02 08:19:50 -07:00
parent a8e13ba1ce
commit 576d3b0735
4 changed files with 10 additions and 10 deletions

View File

@ -26,7 +26,7 @@ class ::Chef::Recipe # rubocop:disable Documentation
end
identity_admin_endpoint = endpoint 'identity-admin'
bootstrap_token = secret 'secrets', 'openstack_identity_bootstrap_token'
bootstrap_token = get_secret 'openstack_identity_bootstrap_token'
auth_uri = ::URI.decode identity_admin_endpoint.to_s
service_pass = get_password 'service', 'openstack-compute'
service_user = node['openstack']['compute']['service_user']

View File

@ -35,7 +35,7 @@ end
# TODO(srenatus) there might be multiple secrets, cinder will tell nova-compute
# which one should be used for each single volume mount request
Chef::Log.info("rbd_secret_name: #{node['openstack']['compute']['libvirt']['rbd']['rbd_secret_name']}")
secret_uuid = secret 'secrets', node['openstack']['compute']['libvirt']['rbd']['rbd_secret_name']
secret_uuid = get_secret node['openstack']['compute']['libvirt']['rbd']['rbd_secret_name']
ceph_key = get_password 'service', 'rbd_block_storage'
require 'securerandom'

View File

@ -111,14 +111,14 @@ Chef::Log.debug("openstack-compute::nova-common:image_endpoint|#{image_endpoint.
if node['openstack']['compute']['network']['service_type'] == 'neutron'
neutron_admin_password = get_password 'service', 'openstack-network'
neutron_metadata_proxy_shared_secret = secret 'secrets', 'neutron_metadata_secret'
neutron_metadata_proxy_shared_secret = get_secret 'neutron_metadata_secret'
else
neutron_admin_password = nil
neutron_metadata_proxy_shared_secret = nil
end
if node['openstack']['compute']['libvirt']['images_type'] == 'rbd'
rbd_secret_uuid = secret 'secrets', node['openstack']['compute']['libvirt']['rbd']['rbd_secret_name']
rbd_secret_uuid = get_secret node['openstack']['compute']['libvirt']['rbd']['rbd_secret_name']
else
rbd_secret_uuid = nil
end

View File

@ -43,14 +43,14 @@ shared_context 'compute_stubs' do
}
}]
)
Chef::Recipe.any_instance.stub(:secret)
.with('secrets', 'openstack_identity_bootstrap_token')
Chef::Recipe.any_instance.stub(:get_secret)
.with('openstack_identity_bootstrap_token')
.and_return('bootstrap-token')
Chef::Recipe.any_instance.stub(:secret)
.with('secrets', 'neutron_metadata_secret')
Chef::Recipe.any_instance.stub(:get_secret)
.with('neutron_metadata_secret')
.and_return('metadata-secret')
Chef::Recipe.any_instance.stub(:secret) # this is the rbd_uuid default name
.with('secrets', 'rbd_secret_uuid')
Chef::Recipe.any_instance.stub(:get_secret) # this is the rbd_uuid default name
.with('rbd_secret_uuid')
.and_return '00000000-0000-0000-0000-000000000000'
Chef::Recipe.any_instance.stub(:get_password)
.with('db', anything)