Only add Glance Image Cache info if needed
Only add the parameters for the Glance Image Cache is this has been selected to be enabled in the Fuel GUI Also make sure the Cinder tenant and user IDs are 32 characters long. Change-Id: I2f11ceda93fb13bf94db4774b79dd02c20cf0613
This commit is contained in:
parent
3622db6bce
commit
6d08960104
|
@ -11,7 +11,8 @@ module Puppet::Parser::Functions
|
|||
alpha = ('a'..'f').to_a
|
||||
length = args[0].to_i
|
||||
CHARS = (alpha + numbers)
|
||||
id = CHARS.sort_by { rand }.join[0...length]
|
||||
id_sub = CHARS.sort_by { rand }.join[0...length]
|
||||
id = id_sub + id_sub
|
||||
return id
|
||||
end
|
||||
end
|
||||
|
|
|
@ -73,13 +73,16 @@ class plugin_purestorage_cinder::controller (
|
|||
# Luckily the glance image cache doesn't actually use keystone to check the IDs so
|
||||
# we can just, temporarily, assign a randon ID to the two fields.
|
||||
# When keystone-puppet has the functionality we need we will fix this workaround
|
||||
|
||||
if $plugin_settings['pure_glance_image_cache'] {
|
||||
|
||||
if $plugin_settings['pure_glance_image_cache'] == 'true' {
|
||||
$PROJECT_ID = get_random_id(32)
|
||||
$USER_ID = get_random_id(32)
|
||||
cinder_config {
|
||||
cinder_config {
|
||||
"DEFAULT/cinder_internal_tenant_project_id": value => "$PROJECT_ID";
|
||||
"DEFAULT/cinder_internal_tenant_user_id": value => "$USER_ID";
|
||||
"$section/image_volume_cache_enabled": value => $plugin_settings["pure_glance_image_cache"];
|
||||
"$section/image_volume_cache_max_count": value => $plugin_settings["pure_glance_cache_count"];
|
||||
"$section/image_volume_cache_max_size_gb": value => $plugin_settings["pure_glance_cache_size"];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -90,10 +93,7 @@ class plugin_purestorage_cinder::controller (
|
|||
use_chap_auth => $plugin_settings['pure_chap'],
|
||||
use_multipath_for_image_xfer => $plugin_settings['pure_multipath'],
|
||||
pure_storage_protocol => $plugin_settings['pure_protocol'],
|
||||
extra_options => { "$section/backend_host" => { value => $section },
|
||||
"$section/image_volume_cache_enabled" => { value => $plugin_settings["pure_glance_image_cache"] },
|
||||
"$section/image_volume_cache_max_count" => { value => $plugin_settings["pure_glance_cache_count"] },
|
||||
"$section/image_volume_cache_max_size_gb" => { value => $plugin_settings["pure_glance_cache_size"] }
|
||||
extra_options => { "$section/backend_host" => { value => $section }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue