]> review.fuel-infra Code Review - puppet-modules/puppet-ceilometer.git/commitdiff
Remove deprecated keystone::auth options
authorIury Gregory Melo Ferreira <iurygregory@gmail.com>
Fri, 3 Jun 2016 04:22:44 +0000 (01:22 -0300)
committerIury Gregory Melo Ferreira <iurygregory@gmail.com>
Fri, 3 Jun 2016 04:33:33 +0000 (01:33 -0300)
Change-Id: Ic1764835e9c06623b1aef788485c9cfd9a01284f

manifests/keystone/auth.pp
releasenotes/notes/remove_deprecated_keystone_auth_options-7702c56e6cc49f3c.yaml [new file with mode: 0644]
spec/classes/ceilometer_keystone_auth_spec.rb

index c699d12e9c564b8544470eba3b15ae77190d1de4..62dfaa2eda33da6e479cdf7b8541c7e37c8b5297 100644 (file)
 #   This url should *not* contain any trailing '/'.
 #   Defaults to 'http://127.0.0.1:8777'.
 #
-# [*port*]
-#   (Optional) DEPRECATED: Use public_url, internal_url and admin_url instead.
-#   Setting this parameter overrides public_url, internal_url and admin_url parameters.
-#   Default port for endpoints.
-#   Defaults to 8777.
-#
-# [*public_protocol*]
-#   (Optional) DEPRECATED: Use public_url instead.
-#   Protocol for public endpoint.
-#   Setting this parameter overrides public_url parameter.
-#   Defaults to 'http'.
-#
-# [*public_address*]
-#   (Optional) DEPRECATED: Use public_url instead.
-#   Public address for endpoint.
-#   Setting this parameter overrides public_url parameter.
-#   Defaults to '127.0.0.1'.
-#
-# [*internal_protocol*]
-#   (Optional) DEPRECATED: Use internal_url instead.
-#   Protocol for internal endpoint.
-#   Setting this parameter overrides internal_url parameter.
-#   Defaults to 'http'.
-#
-# [*internal_address*]
-#   (Optional) DEPRECATED: Use internal_url instead.
-#   Internal address for endpoint.
-#   Setting this parameter overrides internal_url parameter.
-#   Defaults to '127.0.0.1'.
-#
-# [*admin_protocol*]
-#   (Optional) DEPRECATED: Use admin_url instead.
-#   Protocol for admin endpoint.
-#   Setting this parameter overrides admin_url parameter.
-#   Defaults to 'http'.
-#
-# [*admin_address*]
-#   (Optional) DEPRECATED: Use admin_url instead.
-#   Admin address for endpoint.
-#   Setting this parameter overrides admin_url parameter.
-#   Defaults to '127.0.0.1'.
-#
-# === Deprecation notes:
-#
-# If any value is provided for public_protocol, public_address or port parameters,
-# public_url will be completely ignored. The same applies for internal and admin parameters.
-#
 # === Examples:
 #
 #  class { 'ceilometer::keystone::auth':
@@ -132,75 +85,12 @@ class ceilometer::keystone::auth (
   $public_url           = 'http://127.0.0.1:8777',
   $admin_url            = 'http://127.0.0.1:8777',
   $internal_url         = 'http://127.0.0.1:8777',
-  # DEPRECATED PARAMETERS
-  $port                 = undef,
-  $public_protocol      = undef,
-  $public_address       = undef,
-  $internal_protocol    = undef,
-  $internal_address     = undef,
-  $admin_protocol       = undef,
-  $admin_address        = undef,
 ) {
 
   validate_string($password)
 
-  if $port {
-    warning('The port parameter is deprecated, use public_url, internal_url and admin_url instead.')
-  }
-
-  if $public_protocol {
-    warning('The public_protocol parameter is deprecated, use public_url instead.')
-  }
-
-  if $internal_protocol {
-    warning('The internal_protocol parameter is deprecated, use internal_url instead.')
-  }
-
-  if $admin_protocol {
-    warning('The admin_protocol parameter is deprecated, use admin_url instead.')
-  }
-
-  if $public_address {
-    warning('The public_address parameter is deprecated, use public_url instead.')
-  }
-
-  if $internal_address {
-    warning('The internal_address parameter is deprecated, use internal_url instead.')
-  }
-
-  if $admin_address {
-    warning('The admin_address parameter is deprecated, use admin_url instead.')
-  }
-
   $service_name_real = pick($service_name, $auth_name)
 
-  if ($public_protocol or $public_address or $port) {
-    $public_url_real = sprintf('%s://%s:%s',
-      pick($public_protocol, 'http'),
-      pick($public_address, '127.0.0.1'),
-      pick($port, '8777'))
-  } else {
-    $public_url_real = $public_url
-  }
-
-  if ($admin_protocol or $admin_address or $port) {
-    $admin_url_real = sprintf('%s://%s:%s',
-      pick($admin_protocol, 'http'),
-      pick($admin_address, '127.0.0.1'),
-      pick($port, '8777'))
-  } else {
-    $admin_url_real = $admin_url
-  }
-
-  if ($internal_protocol or $internal_address or $port) {
-    $internal_url_real = sprintf('%s://%s:%s',
-      pick($internal_protocol, 'http'),
-      pick($internal_address, '127.0.0.1'),
-      pick($port, '8777'))
-  } else {
-    $internal_url_real = $internal_url
-  }
-
   ::keystone::resource::service_identity { $auth_name:
     configure_user      => $configure_user,
     configure_user_role => $configure_user_role,
@@ -213,9 +103,9 @@ class ceilometer::keystone::auth (
     email               => $email,
     tenant              => $tenant,
     roles               => ['admin', 'ResellerAdmin'],
-    public_url          => $public_url_real,
-    admin_url           => $admin_url_real,
-    internal_url        => $internal_url_real,
+    public_url          => $public_url,
+    admin_url           => $admin_url,
+    internal_url        => $internal_url,
   }
 
   if $configure_user_role {
diff --git a/releasenotes/notes/remove_deprecated_keystone_auth_options-7702c56e6cc49f3c.yaml b/releasenotes/notes/remove_deprecated_keystone_auth_options-7702c56e6cc49f3c.yaml
new file mode 100644 (file)
index 0000000..305d643
--- /dev/null
@@ -0,0 +1,3 @@
+---
+other:
+ - Remove deprecated auth options for ::keystone::auth class
index 1b85b99cd76b10b8101dfea6a23fa2dba348fef9..967be644edcf4361bf918ca3048e43e7c6f67163 100644 (file)
@@ -114,32 +114,6 @@ describe 'ceilometer::keystone::auth' do
       end
     end
 
-    context 'with deprecated parameters' do
-      before do
-        params.merge!({
-          :auth_name         => 'mighty-ceilometer',
-          :region            => 'RegionFortyTwo',
-          :public_address    => '10.0.0.1',
-          :admin_address     => '10.0.0.2',
-          :internal_address  => '10.0.0.3',
-          :port              => '65001',
-          :public_protocol   => 'https',
-          :admin_protocol    => 'ftp',
-          :internal_protocol => 'gopher',
-          :service_type      => 'metering',
-        })
-      end
-
-      it 'configure ceilometer endpoints' do
-        is_expected.to contain_keystone_endpoint("#{params[:region]}/#{params[:auth_name]}::#{params[:service_type]}").with(
-          :ensure       => 'present',
-          :public_url   => "#{params[:public_protocol]}://#{params[:public_address]}:#{params[:port]}",
-          :admin_url    => "#{params[:admin_protocol]}://#{params[:admin_address]}:#{params[:port]}",
-          :internal_url => "#{params[:internal_protocol]}://#{params[:internal_address]}:#{params[:port]}"
-        )
-      end
-    end
-
     context 'when overriding service name' do
       before do
         params.merge!({