X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=sidebyside;f=3rdparty%2Fmodules%2Fkeystone%2Flib%2Fpuppet%2Ftype%2Fkeystone_tenant.rb;h=449ccd04e36043374bbb21414f1d661e85fd59ae;hb=2dc39f2a756f82040d82cba324b21f44fad8ef3f;hp=6195d23f90b3380c7dc39281375a7215c3682f8d;hpb=d4b6110c989169c702f039a4c7dc1b309685bba3;p=dsa-puppet.git diff --git a/3rdparty/modules/keystone/lib/puppet/type/keystone_tenant.rb b/3rdparty/modules/keystone/lib/puppet/type/keystone_tenant.rb index 6195d23f..449ccd04 100644 --- a/3rdparty/modules/keystone/lib/puppet/type/keystone_tenant.rb +++ b/3rdparty/modules/keystone/lib/puppet/type/keystone_tenant.rb @@ -1,6 +1,7 @@ # LP#1408531 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_tenant) do @@ -34,6 +35,20 @@ Puppet::Type.newtype(:keystone_tenant) do end end + newproperty(:domain) do + desc 'Domain for tenant.' + 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_domain) do + # use the domain parameter if given, or the one from name if any + self[:domain] || Util.split_domain(self[:name])[1] + end + # This ensures the service is started and therefore the keystone # config is configured IF we need them for authentication. # If there is no keystone config, authentication credentials