X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=3rdparty%2Fmodules%2Fkeystone%2Flib%2Fpuppet%2Ftype%2Fkeystone_user.rb;h=f671f3edc6ba4b98862f65617a00ac926ce223bd;hb=87423ba664cd5f2bb462ebadd08b1a90d0fe1c8d;hp=b484e7c5fd2a2cb2b71bf680e4bf5086804a5adb;hpb=71a236efd9f45828d875a0a5fd025108bb1dcada;p=mirror%2Fdsa-puppet.git diff --git a/3rdparty/modules/keystone/lib/puppet/type/keystone_user.rb b/3rdparty/modules/keystone/lib/puppet/type/keystone_user.rb index b484e7c5f..f671f3edc 100644 --- a/3rdparty/modules/keystone/lib/puppet/type/keystone_user.rb +++ b/3rdparty/modules/keystone/lib/puppet/type/keystone_user.rb @@ -2,6 +2,8 @@ File.expand_path('../..', File.dirname(__FILE__)).tap { |dir| $LOAD_PATH.unshift(dir) unless $LOAD_PATH.include?(dir) } File.expand_path('../../../../openstacklib/lib', File.dirname(__FILE__)).tap { |dir| $LOAD_PATH.unshift(dir) unless $LOAD_PATH.include?(dir) } +require 'puppet/provider/keystone/util' + Puppet::Type.newtype(:keystone_user) do desc 'Type for managing keystone users.' @@ -13,6 +15,11 @@ Puppet::Type.newtype(:keystone_user) do end newparam(:ignore_default_tenant) do + # DEPRECATED - To be removed in next release (Liberty) + # https://bugs.launchpad.net/puppet-keystone/+bug/1472437 + validate do |v| + Puppet.warning('The ignore_default_tenant parameter is deprecated and will be removed in the future.') + end newvalues(/(t|T)rue/, /(f|F)alse/, true, false) defaultto(false) munge do |value| @@ -48,6 +55,11 @@ Puppet::Type.newtype(:keystone_user) do end newproperty(:tenant) do + # DEPRECATED - To be removed in next release (Liberty) + # https://bugs.launchpad.net/puppet-keystone/+bug/1472437 + validate do |v| + Puppet.warning('The tenant parameter is deprecated and will be removed in the future. Please use keystone_user_role to assign a user to a project.') + end newvalues(/\S+/) end @@ -69,10 +81,25 @@ Puppet::Type.newtype(:keystone_user) do end end + newproperty(:domain) do + newvalues(nil, /\S+/) + def insync?(is) + raise(Puppet::Error, "The domain cannot be changed from #{self.should} to #{is}") unless self.should == is + true + end + end + autorequire(:keystone_tenant) do + # DEPRECATED - To be removed in next release (Liberty) + # https://bugs.launchpad.net/puppet-keystone/+bug/1472437 self[:tenant] end + autorequire(:keystone_domain) do + # use the domain parameter if given, or the one from name if any + self[:domain] or Util.split_domain(self[:name])[1] + end + # we should not do anything until the keystone service is started autorequire(:service) do ['keystone']